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.
5 GEN('#include "chrome/browser/ui/browser.h"');
6 GEN('#include "chrome/browser/ui/browser_commands.h"');
7 GEN('#include "chrome/browser/ui/exclusive_access/' +
8 'fullscreen_controller_test.h"');
11 * Fixture for ChromeOs WebUI OOBE testing.
13 * There's one test for each page in the Chrome OS Out-of-box-experience
14 * (OOBE), so that an accessibility audit can be run automatically on
15 * each one. This will alert a developer immediately if they accidentally
16 * forget to label a control, or if a focusable control ends up
17 * off-screen without being disabled, for example.
20 function OobeWebUITest() {}
22 OobeWebUITest.prototype = {
23 __proto__: testing.Test.prototype,
26 browsePreload: 'chrome://oobe/oobe',
29 runAccessibilityChecks: true,
32 accessibilityIssuesAreErrors: true,
35 testGenPreamble: function() {
36 // OobeWebUI should run in fullscreen.
37 GEN(' FullscreenNotificationObserver fullscreen_observer;');
38 GEN(' chrome::ToggleFullscreenMode(browser());');
39 GEN(' fullscreen_observer.Wait();');
44 testing.Test.prototype.setUp.call(this);
46 // Polymer issue https://github.com/Polymer/polymer/issues/1081
47 this.accessibilityAuditConfig.ignoreSelectors('badAriaAttributeValue',
49 this.accessibilityAuditConfig.ignoreSelectors('badAriaAttributeValue',
50 '#progressContainer');
54 function createOobeWebUITestSupervisedManagerData() {
57 { 'username' : 'user@invalid.domain',
58 'displayName' : 'John Doe',
59 'emailAddress' : 'user@invalid.domain'
61 { 'username' : 'other@invalid.domain',
62 'displayName' : 'Joanna Doe',
63 'emailAddress' : 'other@invalid.domain'
69 TEST_F('OobeWebUITest', 'EmptyOobe', function() {
72 TEST_F('OobeWebUITest', 'OobeConnect', function() {
73 Oobe.getInstance().showScreen({'id':'connect'});
76 TEST_F('OobeWebUITest', 'OobeEula', function() {
77 Oobe.getInstance().showScreen({'id':'eula'});
80 TEST_F('OobeWebUITest', 'OobeUpdate', function() {
81 Oobe.getInstance().showScreen({'id':'update'});
84 TEST_F('OobeWebUITest', 'OobeGaiaSignIn', function() {
85 Oobe.getInstance().showScreen({'id':'gaia-signin'});
88 TEST_F('OobeWebUITest', 'OobeSupervisedUsers', function() {
89 Oobe.getInstance().showScreen(
90 {'id' : 'supervised-user-creation',
91 'data' : createOobeWebUITestSupervisedManagerData()});
94 TEST_F('OobeWebUITest', 'OobeSupervisedUsers2', function() {
95 Oobe.getInstance().showScreen(
96 {'id' : 'supervised-user-creation',
97 'data' : createOobeWebUITestSupervisedManagerData()});
98 $('supervised-user-creation').setVisiblePage_('manager');
101 TEST_F('OobeWebUITest', 'OobeSupervisedUsers3', function() {
102 Oobe.getInstance().showScreen(
103 {'id' : 'supervised-user-creation',
104 'data' : createOobeWebUITestSupervisedManagerData()});
105 $('supervised-user-creation').setDefaultImages(
106 [{'url': 'chrome://nothing/', 'title': 'None'},
107 {'url': 'chrome://nothing/', 'title': 'None'}]);
108 $('supervised-user-creation').setVisiblePage_('username');
111 // TODO: this either needs a WebUILoginDisplay instance or some
112 // other way to initialize the appropriate C++ handlers.
113 TEST_F('OobeWebUITest', 'DISABLED_OobeUserImage', function() {
114 Oobe.getInstance().showScreen({'id':'user-image'});
117 // TODO: figure out what state to mock in order for this
118 // screen to show up.
119 TEST_F('OobeWebUITest', 'DISABLED_OobeAccountPicker', function() {
120 Oobe.getInstance().showScreen({'id':'account-picker'});