Plan document share decisions in app core
This commit is contained in:
28
tests/app_core/document_sharing_tests.cpp
Normal file
28
tests/app_core/document_sharing_tests.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user