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

Side by Side Diff: chrome/browser/resources/gaia_auth/test/content.js

Issue 10443024: Added chrome switch that lets tests override URL path, moved GAIA auth extension from CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
Steve Block 2012/06/11 17:39:08 Did you intend for some of these resource files to
4
5 console.log('Test script injected!');
6
7 function getQueryParam(key, defaultVal) {
8 if (!defaultVal) defaultVal = '';
9 key = key.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
10 var regex = new RegExp('[\\?&]' + key + '=([^&#]*)');
11 var qs = regex.exec(window.location.href);
12 if (qs == null)
13 return defaultVal;
14 else
15 return qs[1];
16 }
17
18 if (document.URL.match(/https\:\/\/www\.google\.com\/accounts\/ServiceLogin/) ||
19 document.URL.match(/https\:\/\/accounts\.google\.com\/ServiceLogin/) ||
20 document.URL.match(
21 /https\:\/\/gaiastaging\.corp\.google\.com\/ServiceLogin/) ||
22 document.URL.match(/https\:\/\/insecure\.com\/accounts\/ServiceLogin/)) {
23 var testEmail = unescape(getQueryParam('test_email'));
24 var testPassword = unescape(getQueryParam('test_pwd'));
25 console.log('Got test account info: ' + testEmail + '/' + testPassword);
26 document.getElementById('Email').value = testEmail;
27 document.getElementById('Passwd').value = testPassword;
28 console.log('Form field changed!');
29 if (testEmail != '') {
30 document.getElementById('signIn').click();
31 console.log('Form submitted!');
32 }
33 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth/success.js ('k') | chrome/browser/resources/gaia_auth/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698