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/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "extensions/browser/extension_system.h" | 35 #include "extensions/browser/extension_system.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
38 | 38 |
39 using ::testing::_; | 39 using ::testing::_; |
40 using ::testing::AnyNumber; | 40 using ::testing::AnyNumber; |
41 using ::testing::Return; | 41 using ::testing::Return; |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
| 45 const char kGaiaId[] = "12345"; |
45 const char kTestUser[] = "test-user@gmail.com"; | 46 const char kTestUser[] = "test-user@gmail.com"; |
46 const char kPassword[] = "password"; | 47 const char kPassword[] = "password"; |
47 | 48 |
48 void FilterFrameByName(std::set<content::RenderFrameHost*>* frame_set, | 49 void FilterFrameByName(std::set<content::RenderFrameHost*>* frame_set, |
49 const std::string& frame_name, | 50 const std::string& frame_name, |
50 content::RenderFrameHost* frame) { | 51 content::RenderFrameHost* frame) { |
51 if (frame->GetFrameName() == frame_name) | 52 if (frame->GetFrameName() == frame_name) |
52 frame_set->insert(frame); | 53 frame_set->insert(frame); |
53 } | 54 } |
54 | 55 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 256 |
256 IN_PROC_BROWSER_TEST_F(LoginOfflineTest, GaiaAuthOffline) { | 257 IN_PROC_BROWSER_TEST_F(LoginOfflineTest, GaiaAuthOffline) { |
257 bool show_user; | 258 bool show_user; |
258 ASSERT_TRUE(chromeos::CrosSettings::Get()->GetBoolean( | 259 ASSERT_TRUE(chromeos::CrosSettings::Get()->GetBoolean( |
259 chromeos::kAccountsPrefShowUserNamesOnSignIn, &show_user)); | 260 chromeos::kAccountsPrefShowUserNamesOnSignIn, &show_user)); |
260 ASSERT_FALSE(show_user); | 261 ASSERT_FALSE(show_user); |
261 | 262 |
262 StartGaiaAuthOffline(); | 263 StartGaiaAuthOffline(); |
263 | 264 |
264 chromeos::UserContext user_context(kTestUser); | 265 chromeos::UserContext user_context(kTestUser); |
| 266 user_context.SetGaiaID(kGaiaId); |
265 user_context.SetKey(chromeos::Key(kPassword)); | 267 user_context.SetKey(chromeos::Key(kPassword)); |
266 SetExpectedCredentials(user_context); | 268 SetExpectedCredentials(user_context); |
267 | 269 |
268 content::WindowedNotificationObserver session_start_waiter( | 270 content::WindowedNotificationObserver session_start_waiter( |
269 chrome::NOTIFICATION_SESSION_STARTED, | 271 chrome::NOTIFICATION_SESSION_STARTED, |
270 content::NotificationService::AllSources()); | 272 content::NotificationService::AllSources()); |
271 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); | 273 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); |
272 session_start_waiter.Wait(); | 274 session_start_waiter.Wait(); |
273 | 275 |
274 TestSystemTrayIsVisible(); | 276 TestSystemTrayIsVisible(); |
275 } | 277 } |
276 | 278 |
277 } // namespace | 279 } // namespace |
OLD | NEW |