OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/user_controller.h" | 5 #include "chrome/browser/chromeos/login/user_controller.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/chromeos/login/user_manager.h" | 8 #include "chrome/browser/chromeos/login/user_manager.h" |
9 #include "chrome/test/base/testing_browser_process.h" | 9 #include "chrome/test/base/testing_browser_process.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 TEST(UserControllerTest, GetNameTooltipIncognitoUser) { | 22 TEST(UserControllerTest, GetNameTooltipIncognitoUser) { |
23 UserController new_user_controller(NULL, true); | 23 UserController new_user_controller(NULL, true); |
24 EXPECT_EQ(UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)), | 24 EXPECT_EQ(UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)), |
25 new_user_controller.GetNameTooltip()); | 25 new_user_controller.GetNameTooltip()); |
26 } | 26 } |
27 | 27 |
28 TEST(UserControllerTest, GetNameTooltipExistingUser) { | 28 TEST(UserControllerTest, GetNameTooltipExistingUser) { |
29 // We need to have NotificationService and g_browser_process initialized | 29 // We need to have NotificationService and g_browser_process initialized |
30 // before we create UserController for existing user. | 30 // before we create UserController for existing user. |
31 // Otherwise we crash with either SEGFAULT or DCHECK. | 31 // Otherwise we crash with either SEGFAULT or DCHECK. |
32 ScopedTestingBrowserProcess browser_process; | |
33 UserManager::User existing_user; | 32 UserManager::User existing_user; |
34 existing_user.set_email("someordinaryuser@domain.com"); | 33 existing_user.set_email("someordinaryuser@domain.com"); |
35 UserController existing_user_controller(NULL, existing_user); | 34 UserController existing_user_controller(NULL, existing_user); |
36 EXPECT_EQ(L"someordinaryuser (domain.com)", | 35 EXPECT_EQ(L"someordinaryuser (domain.com)", |
37 existing_user_controller.GetNameTooltip()); | 36 existing_user_controller.GetNameTooltip()); |
38 } | 37 } |
39 | 38 |
40 } // namespace chromeos | 39 } // namespace chromeos |
OLD | NEW |