test: add test for absolutely positioned progress bar

This commit is contained in:
Liu
2020-10-07 21:53:37 +08:00
parent f0382d435a
commit aa2b501545
4 changed files with 52 additions and 0 deletions
+10
View File
@@ -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)
+20
View File
@@ -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;
}
+11
View File
@@ -141,6 +141,17 @@
</div>
</div>
</div>
<div class="example" id="example-progress-bar">
<div class="example__title">(5) Absolutely positioned progress bar</div>
<div class="example__content">
<div class="message-box">
<div>loading...</div>
<div class="progress">
<div class="progress-bar" id="progressbar"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
+11
View File
@@ -141,6 +141,17 @@
</w>
</w>
</w>
<w class="example" id="example-progress-bar">
<textview class="example__title">(5) Absolutely positioned progress bar</textview>
<w class="example__content">
<w class="message-box">
<textview>loading...</textview>
<w class="progress">
<w class="progress-bar" id="example-progress-bar__bar"></w>
</w>
</w>
</w>
</w>
</w>
</w>
<scrollbar target="main" />