Plan UI observer frame clipping
This commit is contained in:
@@ -1028,6 +1028,25 @@ if(TARGET pano_cli)
|
||||
WILL_FAIL TRUE
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-app-frame\".*\"message\":\"resize dimensions")
|
||||
|
||||
add_test(NAME pano_cli_plan_app_frame_observer_smoke
|
||||
COMMAND pano_cli plan-app-frame)
|
||||
set_tests_properties(pano_cli_plan_app_frame_observer_smoke PROPERTIES
|
||||
LABELS "app;ui;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-app-frame\".*\"observer\":\\{\"drawNode\":true,\"notifyEnterScreen\":true,\"notifyLeaveScreen\":false,\"nextOnScreen\":true,\"visibleWidth\":65,\"visibleHeight\":35,\"scissorX\":28,\"scissorY\":433,\"scissorWidth\":134,\"scissorHeight\":74\\}")
|
||||
|
||||
add_test(NAME pano_cli_plan_app_frame_observer_clipped_smoke
|
||||
COMMAND pano_cli plan-app-frame --observer-on-screen --observer-clipped-out)
|
||||
set_tests_properties(pano_cli_plan_app_frame_observer_clipped_smoke PROPERTIES
|
||||
LABELS "app;ui;integration;desktop-fast;fuzz"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-app-frame\".*\"observer\":\\{\"drawNode\":false,\"notifyEnterScreen\":false,\"notifyLeaveScreen\":true,\"nextOnScreen\":false")
|
||||
|
||||
add_test(NAME pano_cli_plan_app_frame_rejects_bad_observer
|
||||
COMMAND pano_cli plan-app-frame --observer-bad-geometry)
|
||||
set_tests_properties(pano_cli_plan_app_frame_rejects_bad_observer PROPERTIES
|
||||
LABELS "app;ui;integration;desktop-fast;fuzz"
|
||||
WILL_FAIL TRUE
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-app-frame\".*\"message\":\"UI observer geometry")
|
||||
|
||||
add_test(NAME pano_cli_plan_app_thread_dispatch_smoke
|
||||
COMMAND pano_cli plan-app-thread --kind dispatch --unique --queued-tasks 2 --wait)
|
||||
set_tests_properties(pano_cli_plan_app_thread_dispatch_smoke PROPERTIES
|
||||
|
||||
@@ -101,6 +101,129 @@ void resize_plan_rejects_invalid_dimensions(pp::tests::Harness& harness)
|
||||
PP_EXPECT(harness, !pp::app::plan_app_resize(std::nanf(""), 720.0F));
|
||||
}
|
||||
|
||||
void ui_observer_plan_projects_visible_clip_to_scissor(pp::tests::Harness& harness)
|
||||
{
|
||||
const pp::app::AppUiObserverParentClip parents[] {
|
||||
{
|
||||
.clip = {
|
||||
.x = 0.0F,
|
||||
.y = 0.0F,
|
||||
.width = 80.0F,
|
||||
.height = 60.0F,
|
||||
},
|
||||
.padding_top = 5.0F,
|
||||
.padding_right = 5.0F,
|
||||
.padding_bottom = 5.0F,
|
||||
.padding_left = 5.0F,
|
||||
},
|
||||
};
|
||||
|
||||
const auto plan = pp::app::plan_app_ui_observer(
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
{
|
||||
.x = 10.0F,
|
||||
.y = 20.0F,
|
||||
.width = 100.0F,
|
||||
.height = 50.0F,
|
||||
},
|
||||
parents,
|
||||
540.0F,
|
||||
2.0F,
|
||||
10.0F,
|
||||
5.0F);
|
||||
|
||||
PP_EXPECT(harness, plan);
|
||||
if (plan) {
|
||||
PP_EXPECT(harness, plan.value().draw_node);
|
||||
PP_EXPECT(harness, plan.value().notify_enter_screen);
|
||||
PP_EXPECT(harness, !plan.value().notify_leave_screen);
|
||||
PP_EXPECT(harness, plan.value().next_on_screen);
|
||||
PP_EXPECT(harness, plan.value().visible_clip.width == 65.0F);
|
||||
PP_EXPECT(harness, plan.value().visible_clip.height == 35.0F);
|
||||
PP_EXPECT(harness, plan.value().scissor_x == 28);
|
||||
PP_EXPECT(harness, plan.value().scissor_y == 433);
|
||||
PP_EXPECT(harness, plan.value().scissor_width == 134);
|
||||
PP_EXPECT(harness, plan.value().scissor_height == 74);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_observer_plan_notifies_leave_for_clipped_visible_node(pp::tests::Harness& harness)
|
||||
{
|
||||
const pp::app::AppUiObserverParentClip parents[] {
|
||||
{
|
||||
.clip = {
|
||||
.x = 0.0F,
|
||||
.y = 0.0F,
|
||||
.width = 10.0F,
|
||||
.height = 10.0F,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const auto plan = pp::app::plan_app_ui_observer(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
{
|
||||
.x = 100.0F,
|
||||
.y = 100.0F,
|
||||
.width = 10.0F,
|
||||
.height = 10.0F,
|
||||
},
|
||||
parents,
|
||||
540.0F,
|
||||
1.0F,
|
||||
0.0F,
|
||||
0.0F);
|
||||
|
||||
PP_EXPECT(harness, plan);
|
||||
if (plan) {
|
||||
PP_EXPECT(harness, !plan.value().draw_node);
|
||||
PP_EXPECT(harness, plan.value().notify_leave_screen);
|
||||
PP_EXPECT(harness, !plan.value().next_on_screen);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_observer_plan_rejects_bad_geometry(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
!pp::app::plan_app_ui_observer(
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
{
|
||||
.x = 0.0F,
|
||||
.y = 0.0F,
|
||||
.width = 10.0F,
|
||||
.height = 10.0F,
|
||||
},
|
||||
{},
|
||||
540.0F,
|
||||
0.0F,
|
||||
0.0F,
|
||||
0.0F));
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
!pp::app::plan_app_ui_observer(
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
{
|
||||
.x = std::nanf(""),
|
||||
.y = 0.0F,
|
||||
.width = 10.0F,
|
||||
.height = 10.0F,
|
||||
},
|
||||
{},
|
||||
540.0F,
|
||||
1.0F,
|
||||
0.0F,
|
||||
0.0F));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
@@ -115,5 +238,8 @@ int main()
|
||||
harness.run("tick plan selects available layouts", tick_plan_selects_available_layouts);
|
||||
harness.run("resize plan projects render target and redraw", resize_plan_projects_render_target_and_redraw);
|
||||
harness.run("resize plan rejects invalid dimensions", resize_plan_rejects_invalid_dimensions);
|
||||
harness.run("ui observer plan projects visible clip to scissor", ui_observer_plan_projects_visible_clip_to_scissor);
|
||||
harness.run("ui observer plan notifies leave for clipped visible node", ui_observer_plan_notifies_leave_for_clipped_visible_node);
|
||||
harness.run("ui observer plan rejects bad geometry", ui_observer_plan_rejects_bad_geometry);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user