diff options
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 |