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

Unified Diff: chrome/test/data/chromeos/service_login.html

Issue 13542003: Add browser test for new user CrOS login flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 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
Index: chrome/test/data/chromeos/service_login.html
diff --git a/chrome/test/data/chromeos/service_login.html b/chrome/test/data/chromeos/service_login.html
new file mode 100644
index 0000000000000000000000000000000000000000..91db47139e7488808db52f31f8a0f31d45b87f8c
--- /dev/null
+++ b/chrome/test/data/chromeos/service_login.html
@@ -0,0 +1,73 @@
+<HTML>
+<HEAD>
+<SCRIPT>
+var gaia = gaia || {};
+gaia.chromeOSLogin = {};
+
+gaia.chromeOSLogin.parent_page_url_ =
+'chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/main.html';
+
+gaia.chromeOSLogin.attemptLogin = function(email, password, attemptToken) {
+ var msg = {
+ 'method': 'attemptLogin',
+ 'email': email,
+ 'password': password,
+ 'attemptToken': attemptToken
+ };
+ window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
+};
+
+gaia.chromeOSLogin.clearOldAttempts = function() {
+ var msg = {
+ 'method': 'clearOldAttempts'
+ };
+ window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
+};
+
+gaia.chromeOSLogin.onAttemptedLogin = function(emailFormElement,
+ passwordFormElement,
+ continueUrlElement) {
+ var email = emailFormElement.value;
+ var passwd = passwordFormElement.value;
+ var attemptToken = new Date().getTime();
+
+ gaia.chromeOSLogin.attemptLogin(email, passwd, attemptToken);
+
+ if (continueUrlElement) {
+ var prevAttemptIndex = continueUrlElement.value.indexOf('?attemptToken');
+ if (prevAttemptIndex != -1) {
+ continueUrlElement.value =
+ continueUrlElement.value.substr(0, prevAttemptIndex);
+ }
+ continueUrlElement.value += '?attemptToken=' + attemptToken;
+ }
+};
+
+function submitAndGo() {
+ gaia.chromeOSLogin.onAttemptedLogin(document.getElementById("Email"),
+ document.getElementById("Passwd"),
+ document.getElementById("continue"));
+ return true;
+}
+
+function onAuthError() {
+ if (window.domAutomationController) {
+ window.domAutomationController.sendWithId(4444, 'loginfail');
+ }
+}
+
+function onLoad() {
+ gaia.chromeOSLogin.clearOldAttempts();
+}
+</SCRIPT>
+</HEAD>
+<BODY onload='onLoad();'>
+ Local Auth Server:<BR>
+ <FORM action='/ServiceLoginAuth' method=POST onsubmit='submitAndGo()'>
+ <INPUT TYPE=text id="Email" name="Email">
+ <INPUT TYPE=text id="Passwd" name="Passwd">
+ <INPUT TYPE=hidden id="continue" name="continue">
+ <INPUT TYPE=Submit id="signIn">
+ </FORM>
+</BODY>
+</HTML>
« chrome/browser/extensions/user_script_master.cc ('K') | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698