summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-11-20 13:12:13 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-11-21 10:57:23 +0100
commitfec5417ba7392f354494db57c23f7cdd4ff46cf0 (patch)
tree77ac826291500d68e1fff5575e0dc07e317b465c /framework
parentb51ca21cd6435a8c8df8df99e4d75a59ea9a2bf1 (diff)
tdf#121537 Add test
Change-Id: Ifdf46dc79f9b3e2b5ab4c9635619a9d7f598affc Reviewed-on: https://gerrit.libreoffice.org/63654 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 9b3387f57d4a762f681ab5276aff8764426c6aa4) Reviewed-on: https://gerrit.libreoffice.org/63693 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/qa/complex/XTitle/CheckXTitle.java32
1 files changed, 28 insertions, 4 deletions
diff --git a/framework/qa/complex/XTitle/CheckXTitle.java b/framework/qa/complex/XTitle/CheckXTitle.java
index 875ccd90a93a..3a8b143a876f 100644
--- a/framework/qa/complex/XTitle/CheckXTitle.java
+++ b/framework/qa/complex/XTitle/CheckXTitle.java
@@ -18,10 +18,7 @@
package complex.XTitle;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
import util.utils;
import org.junit.After;
@@ -200,6 +197,33 @@ public class CheckXTitle
xDisProv = null;
}
+ /** checks the if SuggestedSaveAsName is displayed in the title */
+ @Test
+ public void checkTitleSuggestedFileName() throws Exception
+ {
+ PropertyValue[] lArgs = new PropertyValue[2];
+
+ lArgs[0] = new PropertyValue();
+ lArgs[0].Name = "Hidden";
+ lArgs[0].Value = Boolean.FALSE;
+ lArgs[1] = new PropertyValue();
+ lArgs[1].Name = "SuggestedSaveAsName";
+ lArgs[1].Value = "suggestme.odt";
+
+ // load doc
+ XComponent xDoc = m_xLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0, lArgs);
+ assertNotNull("Could not load temporary document", xDoc);
+
+ XModel xModel = UnoRuntime.queryInterface( XModel.class, xDoc );
+ XTitle xTitle = UnoRuntime.queryInterface( XTitle.class, xModel.getCurrentController().getFrame() );
+
+ String title = xTitle.getTitle();
+ assertTrue(title.startsWith("suggestme.odt"));
+
+ XDispatchProvider xDisProv = UnoRuntime.queryInterface( XDispatchProvider.class, xModel.getCurrentController() );
+ prepareQueryAndDispatch( xDisProv, UNO_URL_FOR_CLOSING_DOC );
+ }
+
/** @short sets frame title and checks for infinite recursion
@descr sets frame title. then cycles through default and