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

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

Issue 2915913002: [WebAPKs] Display same text for menu & engagement banner (Closed)
Patch Set: Merge branch 'master' into same_infobar_title 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
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..f5fd032003a48307c706d8f9ff957b623b2edae5 100644
--- a/chrome/browser/android/shortcut_info_unittest.cc
+++ b/chrome/browser/android/shortcut_info_unittest.cc
@@ -54,11 +54,19 @@ TEST_F(ShortcutInfoTest, ShortNameFallsBackToName) {
ASSERT_EQ(manifest_.name.string(), info_.short_name);
}
-TEST_F(ShortcutInfoTest, UserTitleBecomesShortName) {
- manifest_.short_name =
- base::NullableString16(base::ASCIIToUTF16("name"), false);
- info_.user_title = base::ASCIIToUTF16("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("name"));
+ base::string16 initial_short_name(base::ASCIIToUTF16("short_name"));
+
+ manifest_.display = blink::kWebDisplayModeStandalone;
+ info_.name = initial_name;
+ info_.short_name = initial_short_name;
+ manifest_.name = base::NullableString16(base::string16(), false);
info_.UpdateFromManifest(manifest_);
- ASSERT_EQ(manifest_.short_name.string(), info_.user_title);
+ ASSERT_EQ(initial_name, info_.name);
+ ASSERT_EQ(initial_short_name, info_.short_name);
}

Powered by Google App Engine
This is Rietveld 408576698