[Libreoffice-commits] core.git: framework/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 20 13:56:39 UTC 2018
framework/qa/complex/XTitle/CheckXTitle.java | 32 +++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
New commits:
commit 9b3387f57d4a762f681ab5276aff8764426c6aa4
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Nov 20 13:12:13 2018 +0100
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Nov 20 14:56:12 2018 +0100
tdf#121537 Add test
Change-Id: Ifdf46dc79f9b3e2b5ab4c9635619a9d7f598affc
Reviewed-on: https://gerrit.libreoffice.org/63654
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/framework/qa/complex/XTitle/CheckXTitle.java b/framework/qa/complex/XTitle/CheckXTitle.java
index c264c893552a..2e982fab586f 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;
@@ -201,6 +198,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
More information about the Libreoffice-commits
mailing list