Index: chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm |
index 635697807076b15bf3ae00af4c569de2368d14d1..4786a2476f4ec176bb3e9e2f561791df1f910718 100644 |
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm |
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm |
@@ -7,6 +7,7 @@ |
#include "base/command_line.h" |
#include "base/mac/scoped_nsobject.h" |
#include "base/strings/sys_string_conversions.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/profiles/profiles_state.h" |
#include "chrome/browser/ui/browser.h" |
@@ -48,9 +49,19 @@ class AvatarButtonControllerTest : public CocoaProfileTest { |
base::scoped_nsobject<AvatarButtonController> controller_; |
}; |
-TEST_F(AvatarButtonControllerTest, ButtonShown) { |
+TEST_F(AvatarButtonControllerTest, GenericButtonShown) { |
EXPECT_FALSE([view() isHidden]); |
- EXPECT_EQ(l10n_util::GetStringUTF16(IDS_SINGLE_PROFILE_DISPLAY_NAME), |
+ // We only have one local profile, which means we are displaying the |
+ // generic avatar button. |
+ EXPECT_EQ(base::string16(), base::SysNSStringToUTF16([button() title])); |
+} |
+ |
+TEST_F(AvatarButtonControllerTest, ProfileButtonShown) { |
+ // Create a second profile, to force the button to display the profile name. |
+ testing_profile_manager()->CreateTestingProfile("batman"); |
+ |
+ EXPECT_FALSE([view() isHidden]); |
+ EXPECT_EQ(base::ASCIIToUTF16("Person 1"), |
base::SysNSStringToUTF16([button() title])); |
} |
groby-ooo-7-16
2014/09/25 22:03:30
Can you add a test for the error case, please?
noms (inactive)
2014/09/26 15:49:10
Done.
|