OLD | NEW |
1 // Copyright (c) 2011 The Chromium OS 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 console.log('Test script injected!'); | 5 console.log('Test script injected!'); |
6 | 6 |
7 function getQueryParam(key, defaultVal) { | 7 function getQueryParam(key, defaultVal) { |
8 if (!defaultVal) defaultVal = ''; | 8 if (!defaultVal) defaultVal = ''; |
9 key = key.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]'); | 9 key = key.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]'); |
10 var regex = new RegExp('[\\?&]' + key + '=([^&#]*)'); | 10 var regex = new RegExp('[\\?&]' + key + '=([^&#]*)'); |
11 var qs = regex.exec(window.location.href); | 11 var qs = regex.exec(window.location.href); |
(...skipping 12 matching lines...) Expand all Loading... |
24 var testPassword = unescape(getQueryParam('test_pwd')); | 24 var testPassword = unescape(getQueryParam('test_pwd')); |
25 console.log('Got test account info: ' + testEmail + '/' + testPassword); | 25 console.log('Got test account info: ' + testEmail + '/' + testPassword); |
26 document.getElementById('Email').value = testEmail; | 26 document.getElementById('Email').value = testEmail; |
27 document.getElementById('Passwd').value = testPassword; | 27 document.getElementById('Passwd').value = testPassword; |
28 console.log('Form field changed!'); | 28 console.log('Form field changed!'); |
29 if (testEmail != '') { | 29 if (testEmail != '') { |
30 document.getElementById('signIn').click(); | 30 document.getElementById('signIn').click(); |
31 console.log('Form submitted!'); | 31 console.log('Form submitted!'); |
32 } | 32 } |
33 } | 33 } |
OLD | NEW |