Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: chrome/browser/chromeos/login/login_browsertest.cc

Issue 1151513002: ChromeOS Offline gaia: Don't do reload when using local (offline) gaia (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/login/screen_gaia_signin.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/login/screen_gaia_signin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698