diff options
author | mert <mert.tumer@collabora.com> | 2020-10-22 14:08:11 +0300 |
---|---|---|
committer | Mert Tümer <merttumer@outlook.com> | 2020-10-22 19:18:29 +0300 |
commit | 8575f94931d3c1a436cd9fe551c82c2c126d06de (patch) | |
tree | 5285167f861a45eac37232dc037f4d407d747432 /test | |
parent | Don't show jsdialog tooltips in the Android app, either (diff) | |
download | online-8575f94931d3c1a436cd9fe551c82c2c126d06de.tar.gz online-8575f94931d3c1a436cd9fe551c82c2c126d06de.zip |
Make Themeing related CSS vars UI Configurable
Change-Id: If6e4096dc37573ff116f218ceb4ca14135820ff7
Signed-off-by: mert <mert.tumer@collabora.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/WhiteBoxTests.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp index abd5915cea..b7878543ce 100644 --- a/test/WhiteBoxTests.cpp +++ b/test/WhiteBoxTests.cpp @@ -48,6 +48,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testRequestDetails_local); CPPUNIT_TEST(testRequestDetails); CPPUNIT_TEST(testUIDefaults); + CPPUNIT_TEST(testCSSVars); CPPUNIT_TEST_SUITE_END(); @@ -71,6 +72,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture void testRequestDetails_local(); void testRequestDetails(); void testUIDefaults(); + void testCSSVars(); }; void WhiteBoxTests::testLOOLProtocolFunctions() @@ -1597,6 +1599,21 @@ void WhiteBoxTests::testUIDefaults() FileServerRequestHandler::uiDefaultsToJSON(";;UIMode=notebookbar;;PresentationStatusbar=false;;TextRuler=true;;bah=ugh;;SpreadsheetSidebar=false")); } +void WhiteBoxTests::testCSSVars() +{ + LOK_ASSERT_EQUAL(std::string("<style>:root {--co-somestyle-text:#123456;--co-somestyle-size:15px;}</style>"), + FileServerRequestHandler::cssVarsToStyle("--co-somestyle-text=#123456;--co-somestyle-size=15px;")); + + LOK_ASSERT_EQUAL(std::string("<style>:root {--co-somestyle-text:#123456;--co-somestyle-size:15px;}</style>"), + FileServerRequestHandler::cssVarsToStyle(";;--co-somestyle-text=#123456;;--co-somestyle-size=15px;;;")); + + LOK_ASSERT_EQUAL(std::string("<style>:root {--co-somestyle-text:#123456;--co-somestyle-size:15px;}</style>"), + FileServerRequestHandler::cssVarsToStyle("--co-somestyle-text=#123456;;--co-somestyle-size=15px;--co-sometext#324;;")); + + LOK_ASSERT_EQUAL(std::string("<style>:root {--co-somestyle-text:#123456;}</style>"), + FileServerRequestHandler::cssVarsToStyle("--co-somestyle-text=#123456;;--some-val=3453--some-other-val=4536;;")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(WhiteBoxTests); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |