Index: chrome/browser/banners/app_banner_data_fetcher_unittest.cc |
diff --git a/chrome/browser/banners/app_banner_data_fetcher_unittest.cc b/chrome/browser/banners/app_banner_data_fetcher_unittest.cc |
index 4be44feb74fac8636a73d5971473266ca8e8721a..a7dd57f81286c7100128ee855717f3259c11ebba 100644 |
--- a/chrome/browser/banners/app_banner_data_fetcher_unittest.cc |
+++ b/chrome/browser/banners/app_banner_data_fetcher_unittest.cc |
@@ -6,6 +6,7 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/WebKit/public/platform/WebDisplayMode.h" |
namespace banners { |
@@ -23,6 +24,7 @@ class AppBannerDataFetcherUnitTest : public testing::Test { |
manifest.name = ToNullableUTF16("foo"); |
manifest.short_name = ToNullableUTF16("bar"); |
manifest.start_url = GURL("http://example.com"); |
+ manifest.display = blink::WebDisplayModeStandalone; |
content::Manifest::Icon icon; |
icon.type = ToNullableUTF16("image/png"); |
@@ -67,6 +69,23 @@ TEST_F(AppBannerDataFetcherUnitTest, ManifestRequiresNameORShortName) { |
EXPECT_FALSE(IsManifestValid(manifest)); |
} |
+TEST_F(AppBannerDataFetcherUnitTest, ManifestRequiresNonEmptyNameORShortName) { |
+ content::Manifest manifest = GetValidManifest(); |
+ |
+ manifest.name = ToNullableUTF16(""); |
+ manifest.short_name = ToNullableUTF16(""); |
+ EXPECT_FALSE(IsManifestValid(manifest)); |
+ |
+ manifest.name = ToNullableUTF16("foo"); |
+ EXPECT_TRUE(IsManifestValid(manifest)); |
+ |
+ manifest.short_name = ToNullableUTF16(""); |
+ EXPECT_TRUE(IsManifestValid(manifest)); |
dominickn
2016/03/23 11:40:53
Nit: Isn't short_name already empty at this point?
mlamouri (slow - plz ping)
2016/03/23 11:46:10
Correct. I did some changes before upload that mad
|
+ |
+ manifest.name = ToNullableUTF16(""); |
+ EXPECT_FALSE(IsManifestValid(manifest)); |
+} |
+ |
TEST_F(AppBannerDataFetcherUnitTest, ManifestRequiresValidStartURL) { |
content::Manifest manifest = GetValidManifest(); |
@@ -110,4 +129,23 @@ TEST_F(AppBannerDataFetcherUnitTest, ManifestRequiresMinimalSize) { |
EXPECT_TRUE(IsManifestValid(manifest)); |
} |
+TEST_F(AppBannerDataFetcherUnitTest, ManifestDisplayStandaloneFullscreen) { |
+ content::Manifest manifest = GetValidManifest(); |
+ |
+ manifest.display = blink::WebDisplayModeUndefined; |
+ EXPECT_FALSE(IsManifestValid(manifest)); |
+ |
+ manifest.display = blink::WebDisplayModeBrowser; |
+ EXPECT_FALSE(IsManifestValid(manifest)); |
+ |
+ manifest.display = blink::WebDisplayModeMinimalUi; |
+ EXPECT_FALSE(IsManifestValid(manifest)); |
+ |
+ manifest.display = blink::WebDisplayModeStandalone; |
+ EXPECT_TRUE(IsManifestValid(manifest)); |
+ |
+ manifest.display = blink::WebDisplayModeFullscreen; |
+ EXPECT_TRUE(IsManifestValid(manifest)); |
+} |
+ |
} // namespace banners |