[Eraser strings] Remove unused Supervised User infobar and corresponding strings
[chromium-blink-merge.git] / chrome / browser / android / shortcut_info_unittest.cc
blob3abdf88bef41c557a040094ac915eefebe04e142
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/android/shortcut_info.h"
7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/common/manifest.h"
10 #include "testing/gtest/include/gtest/gtest.h"
12 class ShortcutInfoTest : public testing::Test {
13 public:
14 ShortcutInfoTest() = default;
16 protected:
17 ShortcutInfo info_;
18 content::Manifest manifest_;
20 DISALLOW_COPY_AND_ASSIGN(ShortcutInfoTest);
23 TEST_F(ShortcutInfoTest, NameUpdates) {
24 info_.name = base::ASCIIToUTF16("old");
25 manifest_.name = base::NullableString16(base::ASCIIToUTF16("new"), false);
26 info_.UpdateFromManifest(manifest_);
28 ASSERT_EQ(manifest_.name.string(), info_.name);
31 TEST_F(ShortcutInfoTest, ShortNameUpdates) {
32 info_.short_name = base::ASCIIToUTF16("old");
33 manifest_.short_name =
34 base::NullableString16(base::ASCIIToUTF16("new"), false);
35 info_.UpdateFromManifest(manifest_);
37 ASSERT_EQ(manifest_.short_name.string(), info_.short_name);
40 TEST_F(ShortcutInfoTest, NameFallsBackToShortName) {
41 manifest_.short_name =
42 base::NullableString16(base::ASCIIToUTF16("short_name"), false);
43 info_.UpdateFromManifest(manifest_);
45 ASSERT_EQ(manifest_.short_name.string(), info_.name);
48 TEST_F(ShortcutInfoTest, ShortNameFallsBackToName) {
49 manifest_.name = base::NullableString16(base::ASCIIToUTF16("name"), false);
50 info_.UpdateFromManifest(manifest_);
52 ASSERT_EQ(manifest_.name.string(), info_.short_name);
55 TEST_F(ShortcutInfoTest, UserTitleBecomesShortName) {
56 manifest_.short_name =
57 base::NullableString16(base::ASCIIToUTF16("name"), false);
58 info_.user_title = base::ASCIIToUTF16("title");
59 info_.UpdateFromManifest(manifest_);
61 ASSERT_EQ(manifest_.short_name.string(), info_.user_title);