diff --git a/bin/unit_tests/assets/html/border_tests.html b/bin/unit_tests/assets/html/border_tests.html index 7bbebcb2c..a71ec72d2 100644 --- a/bin/unit_tests/assets/html/border_tests.html +++ b/bin/unit_tests/assets/html/border_tests.html @@ -123,49 +123,6 @@
r20
-
-
radius diff
-
tl+br
-
tr+bl
-
mixed
-
tl32
-
- - -
-
part+radius
-
t+r r8
-
b+l r12
-
t+b r8
-
noL r8
-
- -
-
part+radius2
-
noB r8
-
noT r8
-
noR r8
-
t2+l6
-
- - -
-
thick+radius
-
8px/r12
-
12/r16
-
3px/r32
-
t12
-
- - -
-
large boxes
-
96x96
-
96x48
-
48x96
-
mixed96
-
-
diff --git a/bin/unit_tests/assets/html/border_tests_2.html b/bin/unit_tests/assets/html/border_tests_2.html new file mode 100644 index 000000000..1387e192e --- /dev/null +++ b/bin/unit_tests/assets/html/border_tests_2.html @@ -0,0 +1,86 @@ + + + + + + + + + +
+
radius diff
+
tl+br
+
tr+bl
+
mixed
+
tl32
+
+ + +
+
part+radius
+
t+r r8
+
b+l r12
+
t+b r8
+
noL r8
+
+ +
+
part+radius2
+
noB r8
+
noT r8
+
noR r8
+
t2+l6
+
+ + +
+
thick+radius
+
8px/r12
+
12/r16
+
3px/r32
+
t12
+
+ + +
+
large boxes
+
96x96
+
96x48
+
48x96
+
mixed96
+
+ +
+ + diff --git a/bin/unit_tests/assets/html/eepp-ui-border-rendering-2.webp b/bin/unit_tests/assets/html/eepp-ui-border-rendering-2.webp new file mode 100644 index 000000000..d58b7da51 Binary files /dev/null and b/bin/unit_tests/assets/html/eepp-ui-border-rendering-2.webp differ diff --git a/bin/unit_tests/assets/html/eepp-ui-border-rendering.webp b/bin/unit_tests/assets/html/eepp-ui-border-rendering.webp index 68a5cd5c8..4a6d4c8e6 100644 Binary files a/bin/unit_tests/assets/html/eepp-ui-border-rendering.webp and b/bin/unit_tests/assets/html/eepp-ui-border-rendering.webp differ diff --git a/src/tests/unit_tests/uihtml_tests.cpp b/src/tests/unit_tests/uihtml_tests.cpp index ddc7e8f45..767b0a0bb 100644 --- a/src/tests/unit_tests/uihtml_tests.cpp +++ b/src/tests/unit_tests/uihtml_tests.cpp @@ -805,7 +805,7 @@ UTEST( UILayout, listStyleInheritanceFromUl ) { UTEST( UIBorder, renderingVariations ) { auto win = Engine::instance()->createWindow( - WindowSettings( 1200, 900, "Border Rendering Test", WindowStyle::Default, + WindowSettings( 1200, 650, "Border Rendering Test", WindowStyle::Default, WindowBackend::Default, 32, {}, 1, false, true ), ContextSettings( false, 0, 0, GLv_default, true, false ) ); FileSystem::changeWorkingDirectory( Sys::getProcessPath() ); @@ -836,3 +836,37 @@ UTEST( UIBorder, renderingVariations ) { Engine::destroySingleton(); } + +UTEST( UIBorder, renderingVariations2 ) { + auto win = Engine::instance()->createWindow( + WindowSettings( 1200, 650, "Border Rendering Test 2", WindowStyle::Default, + WindowBackend::Default, 32, {}, 1, false, true ), + ContextSettings( false, 0, 0, GLv_default, true, false ) ); + FileSystem::changeWorkingDirectory( Sys::getProcessPath() ); + + FontTrueType* font = FontTrueType::New( "NotoSans-Regular" ); + font->loadFromFile( "../assets/fonts/NotoSans-Regular.ttf" ); + ASSERT_TRUE( font != nullptr && font->loaded() ); + FontFamily::loadFromRegular( font ); + + UI::UISceneNode* sceneNode = UI::UISceneNode::New(); + SceneManager::instance()->add( sceneNode ); + UI::UIThemeManager* themeManager = sceneNode->getUIThemeManager(); + themeManager->setDefaultFont( font ); + sceneNode->setURI( "file://" + Sys::getProcessPath() + "assets/html/" ); + std::string html; + FileSystem::fileGet( "assets/html/border_tests_2.html", html ); + sceneNode->loadLayoutFromString( HTMLFormatter::HTMLtoXML( html ) ); + win->setClearColor( Color::White ); + + win->getInput()->update(); + SceneManager::instance()->update(); + + win->clear(); + SceneManager::instance()->draw(); + win->display(); + + compareImages( utest_state, utest_result, win, "eepp-ui-border-rendering-2", "html" ); + + Engine::destroySingleton(); +}