diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-25 09:06:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-25 09:07:20 +0200 |
commit | edb9ef41f29bf3477b8985ee409ce2d22214e63f (patch) | |
tree | f66930e0e419bec0da774f5feb3a8666cb605552 /desktop | |
parent | 4266cd19650269c94c63168d1e9cbc105ff297f9 (diff) |
Add lok::Office::getFilterTypes() testcase
Change-Id: I9fa710288729b904f2f1c5b3c575212ef21c8a79
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 0cd88cefffa0..d7b93472c1b5 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -51,11 +51,13 @@ public: void testGetStyles(); void testGetFonts(); void testCreateView(); + void testGetFilterTypes(); CPPUNIT_TEST_SUITE(DesktopLOKTest); CPPUNIT_TEST(testGetStyles); CPPUNIT_TEST(testGetFonts); CPPUNIT_TEST(testCreateView); + CPPUNIT_TEST(testGetFilterTypes); CPPUNIT_TEST_SUITE_END(); uno::Reference<lang::XComponent> mxComponent; @@ -150,6 +152,20 @@ void DesktopLOKTest::testCreateView() closeDoc(); } +void DesktopLOKTest::testGetFilterTypes() +{ + LibLibreOffice_Impl aOffice; + char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice); + + std::stringstream aStream(pJSON); + boost::property_tree::ptree aTree; + boost::property_tree::read_json(aStream, aTree); + + CPPUNIT_ASSERT(aTree.size() > 0); + CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>()); + free(pJSON); +} + CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); CPPUNIT_PLUGIN_IMPLEMENT(); |