OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/system/tray/system_tray.h" | 6 #include "ash/system/tray/system_tray.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chromeos/login/login_manager_test.h" | 10 #include "chrome/browser/chromeos/login/login_manager_test.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "extensions/browser/extension_system.h" | 31 #include "extensions/browser/extension_system.h" |
32 #include "testing/gmock/include/gmock/gmock.h" | 32 #include "testing/gmock/include/gmock/gmock.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
34 | 34 |
35 using ::testing::_; | 35 using ::testing::_; |
36 using ::testing::AnyNumber; | 36 using ::testing::AnyNumber; |
37 using ::testing::Return; | 37 using ::testing::Return; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
| 41 const char kGaiaId[] = "12345"; |
41 const char kTestUser[] = "test-user@gmail.com"; | 42 const char kTestUser[] = "test-user@gmail.com"; |
42 const char kPassword[] = "password"; | 43 const char kPassword[] = "password"; |
43 | 44 |
44 void FilterFrameByName(std::set<content::RenderFrameHost*>* frame_set, | 45 void FilterFrameByName(std::set<content::RenderFrameHost*>* frame_set, |
45 const std::string& frame_name, | 46 const std::string& frame_name, |
46 content::RenderFrameHost* frame) { | 47 content::RenderFrameHost* frame) { |
47 if (frame->GetFrameName() == frame_name) | 48 if (frame->GetFrameName() == frame_name) |
48 frame_set->insert(frame); | 49 frame_set->insert(frame); |
49 } | 50 } |
50 | 51 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 225 |
225 IN_PROC_BROWSER_TEST_F(LoginTest, GaiaAuthOffline) { | 226 IN_PROC_BROWSER_TEST_F(LoginTest, GaiaAuthOffline) { |
226 bool show_user; | 227 bool show_user; |
227 ASSERT_TRUE(chromeos::CrosSettings::Get()->GetBoolean( | 228 ASSERT_TRUE(chromeos::CrosSettings::Get()->GetBoolean( |
228 chromeos::kAccountsPrefShowUserNamesOnSignIn, &show_user)); | 229 chromeos::kAccountsPrefShowUserNamesOnSignIn, &show_user)); |
229 ASSERT_FALSE(show_user); | 230 ASSERT_FALSE(show_user); |
230 | 231 |
231 StartGaiaAuthOffline(); | 232 StartGaiaAuthOffline(); |
232 | 233 |
233 chromeos::UserContext user_context(kTestUser); | 234 chromeos::UserContext user_context(kTestUser); |
| 235 user_context.SetGaiaID(kGaiaId); |
234 user_context.SetKey(chromeos::Key(kPassword)); | 236 user_context.SetKey(chromeos::Key(kPassword)); |
235 SetExpectedCredentials(user_context); | 237 SetExpectedCredentials(user_context); |
236 | 238 |
237 content::WindowedNotificationObserver session_start_waiter( | 239 content::WindowedNotificationObserver session_start_waiter( |
238 chrome::NOTIFICATION_SESSION_STARTED, | 240 chrome::NOTIFICATION_SESSION_STARTED, |
239 content::NotificationService::AllSources()); | 241 content::NotificationService::AllSources()); |
240 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); | 242 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); |
241 session_start_waiter.Wait(); | 243 session_start_waiter.Wait(); |
242 | 244 |
243 TestSystemTrayIsVisible(); | 245 TestSystemTrayIsVisible(); |
244 } | 246 } |
245 | 247 |
246 } // namespace | 248 } // namespace |
OLD | NEW |