Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: chrome/browser/android/shortcut_info_unittest.cc

Issue 2948313002: [Android] Suggest page title for homescreen shortcut when Web Manifest is empty (Closed)
Patch Set: Merge branch 'master' into ignore Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/shortcut_info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_info_unittest.cc
diff --git a/chrome/browser/android/shortcut_info_unittest.cc b/chrome/browser/android/shortcut_info_unittest.cc
index 86826ed29292bc2313f0177a0d1ad033a6b9a83d..3dab27ccc641437a0a4c2d412825e8a6462b4f9b 100644
--- a/chrome/browser/android/shortcut_info_unittest.cc
+++ b/chrome/browser/android/shortcut_info_unittest.cc
@@ -62,3 +62,20 @@ TEST_F(ShortcutInfoTest, UserTitleBecomesShortName) {
ASSERT_EQ(manifest_.short_name.string(), info_.user_title);
}
+
+// Test that if a manifest with an empty name and empty short_name is passed,
+// that ShortcutInfo::UpdateFromManifest() does not overwrite the current
+// ShortcutInfo::name and ShortcutInfo::short_name.
+TEST_F(ShortcutInfoTest, IgnoreEmptyNameAndShortName) {
+ base::string16 initial_name(base::ASCIIToUTF16("initial_name"));
+ base::string16 initial_short_name(base::ASCIIToUTF16("initial_short_name"));
+
+ info_.name = initial_name;
+ info_.short_name = initial_short_name;
+ manifest_.display = blink::kWebDisplayModeStandalone;
+ manifest_.name = base::NullableString16(base::string16(), false);
+ info_.UpdateFromManifest(manifest_);
+
+ ASSERT_EQ(initial_name, info_.name);
+ ASSERT_EQ(initial_short_name, info_.short_name);
+}
« no previous file with comments | « chrome/browser/android/shortcut_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698