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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <HTML>
2 <HEAD>
3 <SCRIPT>
4 var gaia = gaia || {};
5 gaia.chromeOSLogin = {};
6
7 gaia.chromeOSLogin.parent_page_url_ =
8 'chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/main.html';
9
10 gaia.chromeOSLogin.attemptLogin = function(email, password, attemptToken) {
11 var msg = {
12 'method': 'attemptLogin',
13 'email': email,
14 'password': password,
15 'attemptToken': attemptToken
16 };
17 window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
18 };
19
20 gaia.chromeOSLogin.clearOldAttempts = function() {
21 var msg = {
22 'method': 'clearOldAttempts'
23 };
24 window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
25 };
26
27 gaia.chromeOSLogin.onAttemptedLogin = function(emailFormElement,
28 passwordFormElement,
29 continueUrlElement) {
30 var email = emailFormElement.value;
31 var passwd = passwordFormElement.value;
32 var attemptToken = new Date().getTime();
33
34 gaia.chromeOSLogin.attemptLogin(email, passwd, attemptToken);
35
36 if (continueUrlElement) {
37 var prevAttemptIndex = continueUrlElement.value.indexOf('?attemptToken');
38 if (prevAttemptIndex != -1) {
39 continueUrlElement.value =
40 continueUrlElement.value.substr(0, prevAttemptIndex);
41 }
42 continueUrlElement.value += '?attemptToken=' + attemptToken;
43 }
44 };
45
46 function submitAndGo() {
47 gaia.chromeOSLogin.onAttemptedLogin(document.getElementById("Email"),
48 document.getElementById("Passwd"),
49 document.getElementById("continue"));
50 return true;
51 }
52
53 function onAuthError() {
54 if (window.domAutomationController) {
55 window.domAutomationController.sendWithId(4444, 'loginfail');
56 }
57 }
58
59 function onLoad() {
60 gaia.chromeOSLogin.clearOldAttempts();
61 }
62 </SCRIPT>
63 </HEAD>
64 <BODY onload='onLoad();'>
65 Local Auth Server:<BR>
66 <FORM action='/ServiceLoginAuth' method=POST onsubmit='submitAndGo()'>
67 <INPUT TYPE=text id="Email" name="Email">
68 <INPUT TYPE=text id="Passwd" name="Passwd">
69 <INPUT TYPE=hidden id="continue" name="continue">
70 <INPUT TYPE=Submit id="signIn">
71 </FORM>
72 </BODY>
73 </HTML>
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698