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

Unified Diff: chrome/browser/chromeos/login/webview_login_browsertest.cc

Issue 1057393004: Add unit test for the back button in the new GAIA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | google_apis/test/embedded_setup_chromeos.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/webview_login_browsertest.cc
diff --git a/chrome/browser/chromeos/login/webview_login_browsertest.cc b/chrome/browser/chromeos/login/webview_login_browsertest.cc
index 872d821b113fafe5c5a6d2beed41f9bee525cfa9..c3163b205fe231a0c0b56adeb2f1b467f3c59b86 100644
--- a/chrome/browser/chromeos/login/webview_login_browsertest.cc
+++ b/chrome/browser/chromeos/login/webview_login_browsertest.cc
@@ -75,4 +75,38 @@ IN_PROC_BROWSER_TEST_F(WebviewLoginTest, Basic) {
session_start_waiter.Wait();
}
+IN_PROC_BROWSER_TEST_F(WebviewLoginTest, BackButton) {
+ WaitForGaiaPageLoaded();
+
+ // Start: no back button, first page.
+ JsExpect("$('back-button-item').hidden");
+ JsExpect("$('signin-frame').src.indexOf('#identifier') != -1");
+
+ // Next step: back button active, second page.
+ SetSignFormField("identifier", kFakeUserEmail);
+ ExecuteJsInSigninFrame("document.getElementById('nextButton').click();");
+ JsExpect("!$('back-button-item').hidden");
+ JsExpect("$('signin-frame').src.indexOf('#challengepassword') != -1");
+
+ // One step back: no back button, first page.
+ ASSERT_TRUE(content::ExecuteScript(GetLoginUI()->GetWebContents(),
+ "$('back-button-item').click();"));
+ JsExpect("$('back-button-item').hidden");
+ JsExpect("$('signin-frame').src.indexOf('#identifier') != -1");
+
+ // Next step (again): back button active, second page, user id remembered.
+ ExecuteJsInSigninFrame("document.getElementById('nextButton').click();");
+ JsExpect("!$('back-button-item').hidden");
+ JsExpect("$('signin-frame').src.indexOf('#challengepassword') != -1");
+
+ content::WindowedNotificationObserver session_start_waiter(
+ chrome::NOTIFICATION_SESSION_STARTED,
+ content::NotificationService::AllSources());
+
+ SetSignFormField("password", kFakeUserPassword);
+ ExecuteJsInSigninFrame("document.getElementById('nextButton').click();");
+
+ session_start_waiter.Wait();
+}
+
} // namespace chromeos
« no previous file with comments | « no previous file | google_apis/test/embedded_setup_chromeos.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698