| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 "})"; | 178 "})"; |
| 179 ASSERT_TRUE(content::ExecuteScript(web_contents(), js)); | 179 ASSERT_TRUE(content::ExecuteScript(web_contents(), js)); |
| 180 std::string set_email = email_input + ".value = '$Email'"; | 180 std::string set_email = email_input + ".value = '$Email'"; |
| 181 ReplaceSubstringsAfterOffset(&set_email, 0, "$Email", user_email); | 181 ReplaceSubstringsAfterOffset(&set_email, 0, "$Email", user_email); |
| 182 ASSERT_TRUE(content::ExecuteScript(web_contents(), set_email)); | 182 ASSERT_TRUE(content::ExecuteScript(web_contents(), set_email)); |
| 183 ASSERT_TRUE(content::ExecuteScript(web_contents(), | 183 ASSERT_TRUE(content::ExecuteScript(web_contents(), |
| 184 email_next_button + ".fire('tap')")); | 184 email_next_button + ".fire('tap')")); |
| 185 std::string message; | 185 std::string message; |
| 186 do { | 186 do { |
| 187 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 187 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| 188 LOG(ERROR) << message; | |
| 189 } while (message != "\"switchToPassword\""); | 188 } while (message != "\"switchToPassword\""); |
| 190 | 189 |
| 191 std::string set_password = password_input + ".value = '$Password'"; | 190 std::string set_password = password_input + ".value = '$Password'"; |
| 192 ReplaceSubstringsAfterOffset(&set_password, 0, "$Password", password); | 191 ReplaceSubstringsAfterOffset(&set_password, 0, "$Password", password); |
| 193 ASSERT_TRUE(content::ExecuteScript(web_contents(), set_password)); | 192 ASSERT_TRUE(content::ExecuteScript(web_contents(), set_password)); |
| 194 ASSERT_TRUE(content::ExecuteScript(web_contents(), | 193 ASSERT_TRUE(content::ExecuteScript(web_contents(), |
| 195 password_next_button + ".fire('tap')")); | 194 password_next_button + ".fire('tap')")); |
| 196 } | 195 } |
| 197 | 196 |
| 198 void PrepareOfflineLogin() { | 197 void PrepareOfflineLogin() { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 TestSystemTrayIsVisible(); | 326 TestSystemTrayIsVisible(); |
| 328 } | 327 } |
| 329 | 328 |
| 330 IN_PROC_BROWSER_TEST_F(LoginTest, PRE_GaiaAuthOffline) { | 329 IN_PROC_BROWSER_TEST_F(LoginTest, PRE_GaiaAuthOffline) { |
| 331 RegisterUser(kTestUser); | 330 RegisterUser(kTestUser); |
| 332 chromeos::StartupUtils::MarkOobeCompleted(); | 331 chromeos::StartupUtils::MarkOobeCompleted(); |
| 333 chromeos::CrosSettings::Get()->SetBoolean( | 332 chromeos::CrosSettings::Get()->SetBoolean( |
| 334 chromeos::kAccountsPrefShowUserNamesOnSignIn, false); | 333 chromeos::kAccountsPrefShowUserNamesOnSignIn, false); |
| 335 } | 334 } |
| 336 | 335 |
| 337 #if defined(MEMORY_SANITIZER) | 336 IN_PROC_BROWSER_TEST_F(LoginTest, GaiaAuthOffline) { |
| 338 #define MAYBE_GaiaAuthOffline DISABLED_GaiaAuthOffline | |
| 339 #else | |
| 340 #define MAYBE_GaiaAuthOffline GaiaAuthOffline | |
| 341 #endif | |
| 342 IN_PROC_BROWSER_TEST_F(LoginTest, MAYBE_GaiaAuthOffline) { | |
| 343 PrepareOfflineLogin(); | 337 PrepareOfflineLogin(); |
| 344 content::WindowedNotificationObserver session_start_waiter( | 338 content::WindowedNotificationObserver session_start_waiter( |
| 345 chrome::NOTIFICATION_SESSION_STARTED, | 339 chrome::NOTIFICATION_SESSION_STARTED, |
| 346 content::NotificationService::AllSources()); | 340 content::NotificationService::AllSources()); |
| 347 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); | 341 SubmitGaiaAuthOfflineForm(kTestUser, kPassword); |
| 348 session_start_waiter.Wait(); | 342 session_start_waiter.Wait(); |
| 349 | 343 |
| 350 TestSystemTrayIsVisible(); | 344 TestSystemTrayIsVisible(); |
| 351 } | 345 } |
| 352 | 346 |
| 353 } // namespace | 347 } // namespace |
| OLD | NEW |