OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
6 * @fileoverview Common OOBE controller methods. | 6 * @fileoverview Common OOBE controller methods. |
7 */ | 7 */ |
8 | 8 |
9 <include src="test_util.js"> | 9 <include src="test_util.js"> |
10 <include src="../../../../../ui/login/screen.js"> | 10 <include src="../../../../../ui/login/screen.js"> |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 Oobe.skipToLoginForTesting = function() { | 278 Oobe.skipToLoginForTesting = function() { |
279 Oobe.disableSigninUI(); | 279 Oobe.disableSigninUI(); |
280 chrome.send('skipToLoginForTesting'); | 280 chrome.send('skipToLoginForTesting'); |
281 }; | 281 }; |
282 | 282 |
283 /** | 283 /** |
284 * Login for telemetry. | 284 * Login for telemetry. |
285 * @param {string} username Login username. | 285 * @param {string} username Login username. |
286 * @param {string} password Login password. | 286 * @param {string} password Login password. |
287 */ | 287 */ |
288 Oobe.loginForTesting = function(username, password) { | 288 Oobe.loginForTesting = function(username, password, gaia_id) { |
289 Oobe.disableSigninUI(); | 289 Oobe.disableSigninUI(); |
290 chrome.send('skipToLoginForTesting', [username]); | 290 chrome.send('skipToLoginForTesting', [username]); |
291 chrome.send('completeLogin', ['12345', username, password, false]); | 291 if (!gaia_id) { |
| 292 /* TODO (alemate): Remove this backward compatibility hack when |
| 293 as soon as all telemetry tests will pass gaia_id directly. |
| 294 */ |
| 295 gaia_id = '12345'; |
| 296 } |
| 297 chrome.send('completeLogin', [gaia_id, username, password, false]); |
292 }; | 298 }; |
293 | 299 |
294 /** | 300 /** |
295 * Guest login for telemetry. | 301 * Guest login for telemetry. |
296 */ | 302 */ |
297 Oobe.guestLoginForTesting = function() { | 303 Oobe.guestLoginForTesting = function() { |
298 Oobe.skipToLoginForTesting(); | 304 Oobe.skipToLoginForTesting(); |
299 chrome.send('launchIncognito'); | 305 chrome.send('launchIncognito'); |
300 }; | 306 }; |
301 | 307 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { | 421 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { |
416 // This screen is async-loaded so we manually trigger i18n processing. | 422 // This screen is async-loaded so we manually trigger i18n processing. |
417 i18nTemplate.process($('oauth-enrollment'), loadTimeData); | 423 i18nTemplate.process($('oauth-enrollment'), loadTimeData); |
418 // Delayed binding since this isn't defined yet. | 424 // Delayed binding since this isn't defined yet. |
419 login.OAuthEnrollmentScreen.register(); | 425 login.OAuthEnrollmentScreen.register(); |
420 }); | 426 }); |
421 | 427 |
422 cr.ui.Oobe.initialize(); | 428 cr.ui.Oobe.initialize(); |
423 }); | 429 }); |
424 })(); | 430 })(); |
OLD | NEW |