/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace
{ // These were JUnit tests from framework/qa/complex/XTitle/CheckXTitle.java class Test : public UnoApiTest
{ public:
Test()
: UnoApiTest(u"/framework/qa/cppunit/data/"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle)
{ // Cycles through default view and print preview // and asserts that the title doesn't change.
// Open print preview window and get title.
util::URL printPreviewURL;
printPreviewURL.Complete = u".uno::PrintPreview"_ustr;
xParser->parseStrict(printPreviewURL);
uno::Reference<frame::XDispatchProvider> xDispatchProvider(xModel->getCurrentController(),
uno::UNO_QUERY);
xDispatchProvider->queryDispatch(printPreviewURL, u""_ustr, 0);
uno::Reference<frame::XTitle> xTitle2(xFrame, css::uno::UNO_QUERY);
Scheduler::ProcessEventsToIdle();
// Default window title and print preview window title should be the same.
CPPUNIT_ASSERT_EQUAL(defaultTitle, xTitle2->getTitle());
// Close print preview window and check to see if default window title has changed
util::URL closePreviewURL;
closePreviewURL.Complete = u".uno::ClosePreview"_ustr;
xParser->parseStrict(closePreviewURL);
uno::Reference<frame::XDispatchProvider> xDispatchProvider2(xModel->getCurrentController(),
uno::UNO_QUERY);
xDispatchProvider2->queryDispatch(closePreviewURL, u""_ustr, 0);
uno::Reference<frame::XTitle> xTitle3(xFrame, css::uno::UNO_QUERY);
Scheduler::ProcessEventsToIdle();
// Default window title should be the same after closing print preview window.
CPPUNIT_ASSERT_EQUAL(defaultTitle, xTitle3->getTitle());
}
CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck)
{ // Set the frame title, then cycle through default and print preview. Close the window // and check for infinite recursion.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.