Plan display file actions in app core
This commit is contained in:
@@ -615,6 +615,18 @@ if(TARGET pano_cli)
|
||||
LABELS "app;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-picked-path\".*\"path\":\"D:/Paint/demo.ppi\".*\"decision\":\"invoke-callback\"")
|
||||
|
||||
add_test(NAME pano_cli_plan_display_file_empty_smoke
|
||||
COMMAND pano_cli plan-display-file)
|
||||
set_tests_properties(pano_cli_plan_display_file_empty_smoke PROPERTIES
|
||||
LABELS "app;integration;desktop-fast;fuzz"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-display-file\".*\"path\":\"\".*\"decision\":\"ignore-empty-path\"")
|
||||
|
||||
add_test(NAME pano_cli_plan_display_file_selected_smoke
|
||||
COMMAND pano_cli plan-display-file --path D:/Paint/export.png)
|
||||
set_tests_properties(pano_cli_plan_display_file_selected_smoke PROPERTIES
|
||||
LABELS "app;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-display-file\".*\"path\":\"D:/Paint/export.png\".*\"decision\":\"open-external-file\"")
|
||||
|
||||
add_test(NAME pano_cli_simulate_app_session_clean_smoke
|
||||
COMMAND pano_cli simulate-app-session)
|
||||
set_tests_properties(pano_cli_simulate_app_session_clean_smoke PROPERTIES
|
||||
|
||||
@@ -17,6 +17,20 @@ void picked_path_invokes_callback_for_nonempty_path(pp::tests::Harness& harness)
|
||||
pp::app::plan_picked_path("D:/Paint/demo.ppi") == pp::app::PickedPathAction::invoke_callback);
|
||||
}
|
||||
|
||||
void display_file_ignores_empty_path(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_display_file("") == pp::app::DisplayFileAction::ignore_empty_path);
|
||||
}
|
||||
|
||||
void display_file_opens_nonempty_path(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_display_file("D:/Paint/export.png") == pp::app::DisplayFileAction::open_external_file);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -24,5 +38,7 @@ int main()
|
||||
pp::tests::Harness harness;
|
||||
harness.run("picked path ignores empty path", picked_path_ignores_empty_path);
|
||||
harness.run("picked path invokes callback for nonempty path", picked_path_invokes_callback_for_nonempty_path);
|
||||
harness.run("display file ignores empty path", display_file_ignores_empty_path);
|
||||
harness.run("display file opens nonempty path", display_file_opens_nonempty_path);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user