Commit 871f84f2 authored by Ben Wells's avatar Ben Wells Committed by Commit Bot

Add test for check_webapp_display_manifest being false.

This option was added recently without any tests. This change adds a
simple test for this.

Bug: 902937
Change-Id: If35b91e8c43db434921a0a6b01beb708957aecb3
Reviewed-on: https://chromium-review.googlesource.com/c/1343813
Commit-Queue: Ben Wells <benwells@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609925}
parent 648aa9e1
......@@ -38,11 +38,12 @@ class InstallableManagerUnitTest : public testing::Test {
return manifest;
}
bool IsManifestValid(const blink::Manifest& manifest) {
bool IsManifestValid(const blink::Manifest& manifest,
bool check_webapp_manifest_display = true) {
// Explicitly reset the error code before running the method.
manager_->set_valid_manifest_error(NO_ERROR_DETECTED);
return manager_->IsManifestValidForWebApp(
manifest, true /* check_webapp_manifest_display */);
return manager_->IsManifestValidForWebApp(manifest,
check_webapp_manifest_display);
}
InstallableStatusCode GetErrorCode() {
......@@ -189,10 +190,14 @@ TEST_F(InstallableManagerUnitTest, ManifestDisplayModes) {
blink::Manifest manifest = GetValidManifest();
manifest.display = blink::kWebDisplayModeUndefined;
EXPECT_TRUE(
IsManifestValid(manifest, false /* check_webapp_manifest_display */));
EXPECT_FALSE(IsManifestValid(manifest));
EXPECT_EQ(MANIFEST_DISPLAY_NOT_SUPPORTED, GetErrorCode());
manifest.display = blink::kWebDisplayModeBrowser;
EXPECT_TRUE(
IsManifestValid(manifest, false /* check_webapp_manifest_display */));
EXPECT_FALSE(IsManifestValid(manifest));
EXPECT_EQ(MANIFEST_DISPLAY_NOT_SUPPORTED, GetErrorCode());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment