From 4ad8773821f73fa0df665f4d2d4682237a7af677 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 3 Jun 2020 19:46:42 +0300 Subject: Make various bits of the UI configurable. This adds the infrastructure to be able to pass the info which elements like the statusbar / ruler / sidebar are supposed to be shown or hidden on startup of the editor. Change-Id: I188264dec6961074444934ff5fd7088e23b170d4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103169 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tumer --- test/WhiteBoxTests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/WhiteBoxTests.cpp') diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp index 445a7134a..8f53c32ef 100644 --- a/test/WhiteBoxTests.cpp +++ b/test/WhiteBoxTests.cpp @@ -23,6 +23,7 @@ #include #include +#include /// WhiteBox unit-tests. class WhiteBoxTests : public CPPUNIT_NS::TestFixture @@ -48,6 +49,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testRequestDetails_loleafletURI); CPPUNIT_TEST(testRequestDetails_local); CPPUNIT_TEST(testRequestDetails); + CPPUNIT_TEST(testUIDefaults); CPPUNIT_TEST_SUITE_END(); @@ -70,6 +72,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture void testRequestDetails_loleafletURI(); void testRequestDetails_local(); void testRequestDetails(); + void testUIDefaults(); }; void WhiteBoxTests::testLOOLProtocolFunctions() @@ -1563,6 +1566,18 @@ void WhiteBoxTests::testRequestDetails() } } +void WhiteBoxTests::testUIDefaults() +{ + LOK_ASSERT_EQUAL(std::string("{\"uiMode\":\"classic\"}"), + FileServerRequestHandler::uiDefaultsToJSON("UIMode=classic;huh=bleh;")); + + LOK_ASSERT_EQUAL(std::string("{\"spreadsheet\":{\"ShowSidebar\":false},\"text\":{\"ShowRuler\":true}}"), + FileServerRequestHandler::uiDefaultsToJSON("TextRuler=true;SpreadsheetSidebar=false")); + + LOK_ASSERT_EQUAL(std::string("{\"presentation\":{\"ShowStatusbar\":false},\"spreadsheet\":{\"ShowSidebar\":false},\"text\":{\"ShowRuler\":true},\"uiMode\":\"notebookbar\"}"), + FileServerRequestHandler::uiDefaultsToJSON(";;UIMode=notebookbar;;PresentationStatusbar=false;;TextRuler=true;;bah=ugh;;SpreadsheetSidebar=false")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(WhiteBoxTests); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3