framework/qa/complex/XTitle/CheckXTitle.java | 32 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
New commits: commit fec5417ba7392f354494db57c23f7cdd4ff46cf0 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Tue Nov 20 13:12:13 2018 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Wed Nov 21 10:57:23 2018 +0100 tdf#121537 Add test Change-Id: Ifdf46dc79f9b3e2b5ab4c9635619a9d7f598affc Reviewed-on: https://gerrit.libreoffice.org/63654 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> (cherry picked from commit 9b3387f57d4a762f681ab5276aff8764426c6aa4) Reviewed-on: https://gerrit.libreoffice.org/63693 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits