| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/login/user_controller.h" | |
| 6 | |
| 7 #include "base/utf_string_conversions.h" | |
| 8 #include "chrome/browser/chromeos/login/user_manager.h" | |
| 9 #include "chrome/test/base/testing_browser_process.h" | |
| 10 #include "grit/generated_resources.h" | |
| 11 #include "testing/gtest/include/gtest/gtest.h" | |
| 12 #include "ui/base/l10n/l10n_util.h" | |
| 13 | |
| 14 namespace chromeos { | |
| 15 | |
| 16 TEST(UserControllerTest, GetNameTooltipAddUser) { | |
| 17 UserController guest_user_controller(NULL, false); | |
| 18 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ADD_USER), | |
| 19 guest_user_controller.GetNameTooltip()); | |
| 20 } | |
| 21 | |
| 22 TEST(UserControllerTest, GetNameTooltipIncognitoUser) { | |
| 23 UserController new_user_controller(NULL, true); | |
| 24 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON), | |
| 25 new_user_controller.GetNameTooltip()); | |
| 26 } | |
| 27 | |
| 28 TEST(UserControllerTest, GetNameTooltipExistingUser) { | |
| 29 // We need to have NotificationService and g_browser_process initialized | |
| 30 // before we create UserController for existing user. | |
| 31 // Otherwise we crash with either SEGFAULT or DCHECK. | |
| 32 UserManager::User existing_user; | |
| 33 existing_user.set_email("someordinaryuser@domain.com"); | |
| 34 UserController existing_user_controller(NULL, existing_user); | |
| 35 EXPECT_EQ(ASCIIToUTF16("someordinaryuser (domain.com)"), | |
| 36 existing_user_controller.GetNameTooltip()); | |
| 37 } | |
| 38 | |
| 39 } // namespace chromeos | |
| OLD | NEW |