Plan cloud bulk upload progress in app core
This commit is contained in:
@@ -55,6 +55,39 @@ void cloud_download_selection_starts_for_selected_file(pp::tests::Harness& harne
|
||||
pp::app::plan_cloud_download_selection("demo.ppi") == pp::app::CloudDownloadSelectionAction::start_download);
|
||||
}
|
||||
|
||||
void cloud_bulk_upload_shows_progress_when_ui_available(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_cloud_bulk_upload(3, true);
|
||||
PP_EXPECT(harness, plan.file_count == 3);
|
||||
PP_EXPECT(harness, plan.progress_total == 3);
|
||||
PP_EXPECT(harness, plan.show_progress);
|
||||
}
|
||||
|
||||
void cloud_bulk_upload_runs_without_progress_when_ui_unavailable(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_cloud_bulk_upload(3, false);
|
||||
PP_EXPECT(harness, plan.file_count == 3);
|
||||
PP_EXPECT(harness, plan.progress_total == 3);
|
||||
PP_EXPECT(harness, !plan.show_progress);
|
||||
}
|
||||
|
||||
void cloud_bulk_upload_keeps_zero_file_progress_explicit(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_cloud_bulk_upload(0, true);
|
||||
PP_EXPECT(harness, plan.file_count == 0);
|
||||
PP_EXPECT(harness, plan.progress_total == 0);
|
||||
PP_EXPECT(harness, plan.show_progress);
|
||||
}
|
||||
|
||||
void cloud_bulk_upload_clamps_progress_total(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto too_many_files = static_cast<std::size_t>(std::numeric_limits<int>::max()) + 1U;
|
||||
const auto plan = pp::app::plan_cloud_bulk_upload(too_many_files, true);
|
||||
PP_EXPECT(harness, plan.file_count == too_many_files);
|
||||
PP_EXPECT(harness, plan.progress_total == std::numeric_limits<int>::max());
|
||||
PP_EXPECT(harness, plan.show_progress);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -68,5 +101,9 @@ int main()
|
||||
harness.run("cloud browse shows browser with canvas", cloud_browse_shows_browser_with_canvas);
|
||||
harness.run("cloud download selection waits for empty file", cloud_download_selection_waits_for_empty_file);
|
||||
harness.run("cloud download selection starts for selected file", cloud_download_selection_starts_for_selected_file);
|
||||
harness.run("cloud bulk upload shows progress when ui available", cloud_bulk_upload_shows_progress_when_ui_available);
|
||||
harness.run("cloud bulk upload runs without progress when ui unavailable", cloud_bulk_upload_runs_without_progress_when_ui_unavailable);
|
||||
harness.run("cloud bulk upload keeps zero file progress explicit", cloud_bulk_upload_keeps_zero_file_progress_explicit);
|
||||
harness.run("cloud bulk upload clamps progress total", cloud_bulk_upload_clamps_progress_total);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user