| Index: chrome/browser/installable/installable_manager_unittest.cc
|
| diff --git a/chrome/browser/installable/installable_manager_unittest.cc b/chrome/browser/installable/installable_manager_unittest.cc
|
| index 9002ddb7e8a1a0a5eecfcb1baf6da7d45bc93942..b7ec00c5f8e265a1e2ecf2cd73c05b0970248df5 100644
|
| --- a/chrome/browser/installable/installable_manager_unittest.cc
|
| +++ b/chrome/browser/installable/installable_manager_unittest.cc
|
| @@ -8,6 +8,8 @@
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "third_party/WebKit/public/platform/WebDisplayMode.h"
|
|
|
| +using IconPurpose = content::Manifest::Icon::IconPurpose;
|
| +
|
| class InstallableManagerUnitTest : public testing::Test {
|
| public:
|
| InstallableManagerUnitTest() : manager_(new InstallableManager(nullptr)) { }
|
| @@ -27,6 +29,7 @@ class InstallableManagerUnitTest : public testing::Test {
|
| content::Manifest::Icon icon;
|
| icon.type = base::ASCIIToUTF16("image/png");
|
| icon.sizes.push_back(gfx::Size(144, 144));
|
| + icon.purpose.push_back(IconPurpose::ANY);
|
| manifest.icons.push_back(icon);
|
|
|
| return manifest;
|
| @@ -131,6 +134,20 @@ TEST_F(InstallableManagerUnitTest, ManifestRequiresImagePNG) {
|
| EXPECT_EQ(MANIFEST_MISSING_SUITABLE_ICON, GetErrorCode());
|
| }
|
|
|
| +TEST_F(InstallableManagerUnitTest, ManifestRequiresPurposeAny) {
|
| + content::Manifest manifest = GetValidManifest();
|
| +
|
| + // The icon MUST have IconPurpose::ANY at least.
|
| + manifest.icons[0].purpose[0] = IconPurpose::BADGE;
|
| + EXPECT_FALSE(IsManifestValid(manifest));
|
| + EXPECT_EQ(MANIFEST_MISSING_SUITABLE_ICON, GetErrorCode());
|
| +
|
| + // If one of the icon purposes match the requirement, it should be accepted.
|
| + manifest.icons[0].purpose.push_back(IconPurpose::ANY);
|
| + EXPECT_TRUE(IsManifestValid(manifest));
|
| + EXPECT_EQ(NO_ERROR_DETECTED, GetErrorCode());
|
| +}
|
| +
|
| TEST_F(InstallableManagerUnitTest, ManifestRequiresMinimalSize) {
|
| content::Manifest manifest = GetValidManifest();
|
|
|
|
|