set Referer on loading IFrames
[LibreOffice.git] / sw / qa / api / SwXDocumentSettings.cxx
blobda2b366dae9424e0a3626f5ac356d2787d7577b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <test/bootstrapfixture.hxx>
11 #include <test/lang/xserviceinfo.hxx>
12 #include <test/text/textdocumentsettings.hxx>
13 #include <test/text/textprintersettings.hxx>
14 #include <test/text/textsettings.hxx>
15 #include <unotest/macros_test.hxx>
17 #include <com/sun/star/frame/Desktop.hpp>
19 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
21 #include <com/sun/star/text/XTextDocument.hpp>
22 #include <com/sun/star/uno/XInterface.hpp>
24 using namespace css;
26 namespace
28 /**
29 * Test for Java API test of file com.sun.star.comp.Writer.DocumentSettings.csv
31 class SwXDocumentSettings final : public test::BootstrapFixture,
32 public unotest::MacrosTest,
33 public apitest::TextDocumentSettings,
34 public apitest::TextSettings,
35 public apitest::TextPrinterSettings,
36 public apitest::XServiceInfo
38 private:
39 uno::Reference<lang::XComponent> mxComponent;
41 public:
42 virtual void setUp() override;
43 virtual void tearDown() override;
45 SwXDocumentSettings()
46 : apitest::XServiceInfo("SwXDocumentSettings", "com.sun.star.text.DocumentSettings"){};
47 uno::Reference<uno::XInterface> init() override;
49 CPPUNIT_TEST_SUITE(SwXDocumentSettings);
50 CPPUNIT_TEST(testGetImplementationName);
51 CPPUNIT_TEST(testGetSupportedServiceNames);
52 CPPUNIT_TEST(testSupportsService);
53 CPPUNIT_TEST(testDocumentSettingsProperties);
54 CPPUNIT_TEST(testSettingsProperties);
55 CPPUNIT_TEST(testPrinterSettingsProperties);
56 CPPUNIT_TEST_SUITE_END();
59 void SwXDocumentSettings::setUp()
61 test::BootstrapFixture::setUp();
63 mxDesktop.set(frame::Desktop::create(mxComponentContext));
66 void SwXDocumentSettings::tearDown()
68 if (mxComponent.is())
69 mxComponent->dispose();
71 test::BootstrapFixture::tearDown();
74 uno::Reference<uno::XInterface> SwXDocumentSettings::init()
76 mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
77 uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY_THROW);
78 uno::Reference<lang::XMultiServiceFactory> xFactory(xTextDocument, uno::UNO_QUERY_THROW);
80 uno::Reference<uno::XInterface> xDocumentSettings(
81 xFactory->createInstance("com.sun.star.text.DocumentSettings"), uno::UNO_SET_THROW);
83 return xDocumentSettings;
86 CPPUNIT_TEST_SUITE_REGISTRATION(SwXDocumentSettings);
88 } // end anonymous namespace
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */