diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-20 13:12:13 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-20 14:56:12 +0100 |
commit | 9b3387f57d4a762f681ab5276aff8764426c6aa4 (patch) | |
tree | f190c2114f97a5d0a1d490c34d0a78dfb2bba955 /framework/qa/complex | |
parent | 210fbfbbf88ce6957b816e68bc442402b0668e69 (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>
Diffstat (limited to 'framework/qa/complex')
-rw-r--r-- | framework/qa/complex/XTitle/CheckXTitle.java | 32 |
1 files changed, 28 insertions, 4 deletions
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 |