Plan document share decisions in app core

This commit is contained in:
2026-06-02 23:53:09 +02:00
parent cc3490d9d8
commit 777723b68c
10 changed files with 148 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
#include "app_core/document_sharing.h"
#include "test_harness.h"
namespace {
void share_requires_saved_document_path(pp::tests::Harness& harness)
{
PP_EXPECT(
harness,
pp::app::plan_document_share("") == pp::app::DocumentShareAction::show_save_required_warning);
}
void share_allows_nonempty_document_path(pp::tests::Harness& harness)
{
PP_EXPECT(
harness,
pp::app::plan_document_share("D:/Paint/demo.ppi") == pp::app::DocumentShareAction::share_now);
}
}
int main()
{
pp::tests::Harness harness;
harness.run("share requires saved document path", share_requires_saved_document_path);
harness.run("share allows nonempty document path", share_allows_nonempty_document_path);
return harness.finish();
}