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 * TestFixture for kiosk app settings WebUI testing. | 6 * TestFixture for kiosk app settings WebUI testing. |
7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function KioskAppSettingsWebUITest() {} | 10 function KioskAppSettingsWebUITest() {} |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 }); | 83 }); |
84 | 84 |
85 // Verify that enter key on 'kiosk-app-id-edit' adds an app. | 85 // Verify that enter key on 'kiosk-app-id-edit' adds an app. |
86 TEST_F('KioskAppSettingsWebUITest', 'testAddKioskApp', function() { | 86 TEST_F('KioskAppSettingsWebUITest', 'testAddKioskApp', function() { |
87 var testAppId = 'app_3'; | 87 var testAppId = 'app_3'; |
88 var appIdInput = $('kiosk-app-id-edit'); | 88 var appIdInput = $('kiosk-app-id-edit'); |
89 | 89 |
90 appIdInput.value = testAppId; | 90 appIdInput.value = testAppId; |
91 | 91 |
92 this.mockHandler.expects(once()).addKioskApp([testAppId]); | 92 this.mockHandler.expects(once()).addKioskApp([testAppId]); |
93 var keypress = document.createEvent("KeyboardEvents"); | 93 var keypress = document.createEvent('KeyboardEvents'); |
94 keypress.initKeyboardEvent('keypress', true, true, null, 'Enter', ''); | 94 keypress.initKeyboardEvent('keypress', true, true, null, 'Enter', ''); |
95 appIdInput.dispatchEvent(keypress); | 95 appIdInput.dispatchEvent(keypress); |
96 }); | 96 }); |
97 | 97 |
98 // Verify that the 'kiosk-app-add' button adds an app. | 98 // Verify that the 'kiosk-app-add' button adds an app. |
99 TEST_F('KioskAppSettingsWebUITest', 'testAddKioskAppByAddButton', function() { | 99 TEST_F('KioskAppSettingsWebUITest', 'testAddKioskAppByAddButton', function() { |
100 var testAppId = 'app_3'; | 100 var testAppId = 'app_3'; |
101 $('kiosk-app-id-edit').value = testAppId; | 101 $('kiosk-app-id-edit').value = testAppId; |
102 | 102 |
103 this.mockHandler.expects(once()).addKioskApp([testAppId]); | 103 this.mockHandler.expects(once()).addKioskApp([testAppId]); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 var checkbox = $('kiosk-disable-bailout-shortcut'); | 227 var checkbox = $('kiosk-disable-bailout-shortcut'); |
228 | 228 |
229 this.settings_.hasAutoLaunchApp = false; | 229 this.settings_.hasAutoLaunchApp = false; |
230 extensions.KioskAppsOverlay.setSettings(this.settings_); | 230 extensions.KioskAppsOverlay.setSettings(this.settings_); |
231 expectTrue(checkbox.disabled); | 231 expectTrue(checkbox.disabled); |
232 | 232 |
233 this.settings_.hasAutoLaunchApp = true; | 233 this.settings_.hasAutoLaunchApp = true; |
234 extensions.KioskAppsOverlay.setSettings(this.settings_); | 234 extensions.KioskAppsOverlay.setSettings(this.settings_); |
235 expectFalse(checkbox.disabled); | 235 expectFalse(checkbox.disabled); |
236 }); | 236 }); |
OLD | NEW |