From aa2b50154580184e5da453fceeb8fdeea4476273 Mon Sep 17 00:00:00 2001 From: Liu Date: Wed, 7 Oct 2020 21:52:19 +0800 Subject: [PATCH] test: add test for absolutely positioned progress bar --- test/test_block_layout.c | 10 ++++++++++ test/test_block_layout.css | 20 ++++++++++++++++++++ test/test_block_layout.html | 11 +++++++++++ test/test_block_layout.xml | 11 +++++++++++ 4 files changed, 52 insertions(+) diff --git a/test/test_block_layout.c b/test/test_block_layout.c index 641b7441..0686759e 100644 --- a/test/test_block_layout.c +++ b/test/test_block_layout.c @@ -155,6 +155,14 @@ static void test_inline_block_nesting(void) &w->box.border, &rect); } +static void test_absolutely_positioned_progress_bar(void) +{ + LCUI_Widget w; + + w = LCUIWidget_GetById("example-progress-bar__bar"); + it_i("It should have the correct width", (int)w->width, (int)(w->parent->box.content.width * 0.5)); +} + static void test_block_layout_1280(void) { LCUI_Widget w; @@ -418,6 +426,8 @@ static void test_block_layout_1280(void) describe("test auto size", test_auto_size); describe("test dropdown", test_dropdown); describe("test inline block nesting", test_inline_block_nesting); + describe("test absolutely positioned progress bar", + test_absolutely_positioned_progress_bar); } static void test_block_layout_600(void) diff --git a/test/test_block_layout.css b/test/test_block_layout.css index a0ef8d66..f42f7d85 100644 --- a/test/test_block_layout.css +++ b/test/test_block_layout.css @@ -286,3 +286,23 @@ textview, body { right: 5px; position: absolute; } + +#example-progress-bar .message-box { + padding: 15px 25px; + display: inline-block; +} + +#example-progress-bar .progress { + left: 0; + bottom: 0; + width: 100%; + height: 10px; + position: absolute; + background-color: #f0f0f0; +} + +#example-progress-bar .progress-bar { + width: 50%; + height: 100%; + background-color: #7cbbff; +} diff --git a/test/test_block_layout.html b/test/test_block_layout.html index bba66ae6..f90dcc61 100644 --- a/test/test_block_layout.html +++ b/test/test_block_layout.html @@ -141,6 +141,17 @@ +
+
(5) Absolutely positioned progress bar
+
+
+
loading...
+
+
+
+
+
+
diff --git a/test/test_block_layout.xml b/test/test_block_layout.xml index 9b35792c..e56aba60 100644 --- a/test/test_block_layout.xml +++ b/test/test_block_layout.xml @@ -141,6 +141,17 @@ + + (5) Absolutely positioned progress bar + + + loading... + + + + + +