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
3 // found in the LICENSE file.
6 * Fixture for ChromeOs WebUI OOBE testing.
8 * There's one test for each page in the Chrome OS Out-of-box-experience
9 * (OOBE), so that an accessibility audit can be run automatically on
10 * each one. This will alert a developer immediately if they accidentally
11 * forget to label a control, or if a focusable control ends up
12 * off-screen without being disabled, for example.
15 function OobeWebUITest() {}
17 OobeWebUITest.prototype = {
18 __proto__: testing.Test.prototype,
20 browsePreload: 'chrome://oobe/oobe',
25 function createOobeWebUITestSupervisedManagerData() {
28 { 'username' : 'user@invalid.domain',
29 'displayName' : 'John Doe',
30 'emailAddress' : 'user@invalid.domain'
32 { 'username' : 'other@invalid.domain',
33 'displayName' : 'Joanna Doe',
34 'emailAddress' : 'other@invalid.domain'
40 TEST_F('OobeWebUITest', 'EmptyOobe', function() {
43 TEST_F('OobeWebUITest', 'OobeConnect', function() {
44 Oobe.getInstance().showScreen({'id':'connect'});
47 TEST_F('OobeWebUITest', 'OobeEula', function() {
48 Oobe.getInstance().showScreen({'id':'eula'});
51 TEST_F('OobeWebUITest', 'OobeUpdate', function() {
52 Oobe.getInstance().showScreen({'id':'update'});
55 TEST_F('OobeWebUITest', 'OobeGaiaSignIn', function() {
56 Oobe.getInstance().showScreen({'id':'gaia-signin'});
59 TEST_F('OobeWebUITest', 'OobeSupervisedUsers', function() {
60 Oobe.getInstance().showScreen(
61 {'id' : 'supervised-user-creation',
62 'data' : createOobeWebUITestSupervisedManagerData()});
65 TEST_F('OobeWebUITest', 'OobeSupervisedUsers2', function() {
66 Oobe.getInstance().showScreen(
67 {'id' : 'supervised-user-creation',
68 'data' : createOobeWebUITestSupervisedManagerData()});
69 $('supervised-user-creation').setVisiblePage_('manager');
72 TEST_F('OobeWebUITest', 'OobeSupervisedUsers3', function() {
73 Oobe.getInstance().showScreen(
74 {'id' : 'supervised-user-creation',
75 'data' : createOobeWebUITestSupervisedManagerData()});
76 $('supervised-user-creation').setDefaultImages(
77 [{'url': 'chrome://nothing/', 'title': 'None'},
78 {'url': 'chrome://nothing/', 'title': 'None'}]);
79 $('supervised-user-creation').setVisiblePage_('username');
82 // TODO: this either needs a WebUILoginDisplay instance or some
83 // other way to initialize the appropriate C++ handlers.
84 TEST_F('OobeWebUITest', 'DISABLED_OobeUserImage', function() {
85 Oobe.getInstance().showScreen({'id':'user-image'});
88 // TODO: figure out what state to mock in order for this
90 TEST_F('OobeWebUITest', 'DISABLED_OobeAccountPicker', function() {
91 Oobe.getInstance().showScreen({'id':'account-picker'});