summaryrefslogtreecommitdiff
path: root/test/WhiteBoxTests.cpp
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2020-06-03 19:46:42 +0300
committerMert Tumer <mert.tumer@collabora.com>2020-09-28 11:53:16 +0200
commit4ad8773821f73fa0df665f4d2d4682237a7af677 (patch)
tree3ac0bcc358fdb427b00f2413dbc63272f69d5b4d /test/WhiteBoxTests.cpp
parent2b546f72dec43d8ac3bc24c1f767ceb7f617d9be (diff)
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'test/WhiteBoxTests.cpp')
-rw-r--r--test/WhiteBoxTests.cpp15
1 files changed, 15 insertions, 0 deletions
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 <RequestDetails.hpp>
#include <common/Authorization.hpp>
+#include <wsd/FileServer.hpp>
/// 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: */