Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('device_page_tests', function() { | 5 cr.define('device_page_tests', function() { |
| 6 /** @enum {string} */ | 6 /** @enum {string} */ |
| 7 var TestNames = { | 7 var TestNames = { |
| 8 DevicePage: 'device page', | |
| 8 Display: 'display', | 9 Display: 'display', |
| 9 Keyboard: 'keyboard', | 10 Keyboard: 'keyboard', |
| 10 Touchpad: 'touchpad', | 11 Pointers: 'pointers', |
| 11 }; | 12 }; |
| 12 | 13 |
| 13 /** | 14 /** |
| 14 * @constructor | 15 * @constructor |
| 15 * @implements {settings.DevicePageBrowserProxy} | 16 * @implements {settings.DevicePageBrowserProxy} |
| 16 */ | 17 */ |
| 17 function TestDevicePageBrowserProxy() { | 18 function TestDevicePageBrowserProxy() { |
| 18 this.keyboardShortcutsOverlayShown_ = 0; | 19 this.keyboardShortcutsOverlayShown_ = 0; |
| 19 } | 20 } |
| 20 | 21 |
| 21 TestDevicePageBrowserProxy.prototype = { | 22 TestDevicePageBrowserProxy.prototype = { |
| 23 /** override */ | |
| 24 initializePointers: function() { | |
| 25 // Enable mouse and touchpad. | |
| 26 cr.webUIListenerCallback('has-mouse-changed', true); | |
| 27 cr.webUIListenerCallback('has-touchpad-changed', true); | |
| 28 }, | |
| 29 | |
| 22 /** @override */ | 30 /** @override */ |
| 23 handleLinkEvent: function(e) { | 31 handleLinkEvent: function(e) { |
| 24 settings.DevicePageBrowserProxyImpl.prototype.handleLinkEvent.call( | 32 settings.DevicePageBrowserProxyImpl.prototype.handleLinkEvent.call( |
| 25 this, e); | 33 this, e); |
| 26 // Prevent opening the link, which can block the test. | 34 // Prevent opening the link, which can block the test. |
| 27 e.preventDefault(); | 35 e.preventDefault(); |
| 28 }, | 36 }, |
| 29 | 37 |
| 30 /** override */ | 38 /** override */ |
| 31 initializeKeyboard: function() {}, | 39 initializeKeyboard: function() {}, |
| 32 | 40 |
| 33 /** override */ | 41 /** override */ |
| 34 showKeyboardShortcutsOverlay: function() { | 42 showKeyboardShortcutsOverlay: function() { |
| 35 this.keyboardShortcutsOverlayShown_++; | 43 this.keyboardShortcutsOverlayShown_++; |
| 36 }, | 44 }, |
| 37 }; | 45 }; |
| 38 | 46 |
| 39 suite('SettingsDevicePage', function() { | 47 function getFakePrefs() { |
| 40 var fakePrefs = { | 48 return { |
| 41 settings: { | 49 settings: { |
| 42 touchpad: { | 50 touchpad: { |
| 43 enable_tap_to_click: { | 51 enable_tap_to_click: { |
| 44 key: 'settings.touchpad.enable_tap_to_click', | 52 key: 'settings.touchpad.enable_tap_to_click', |
| 45 type: chrome.settingsPrivate.PrefType.BOOLEAN, | 53 type: chrome.settingsPrivate.PrefType.BOOLEAN, |
| 46 value: true, | 54 value: true, |
| 47 }, | 55 }, |
| 48 enable_tap_dragging: { | 56 enable_tap_dragging: { |
| 49 key: 'settings.touchpad.enable_tap_dragging', | 57 key: 'settings.touchpad.enable_tap_dragging', |
| 50 type: chrome.settingsPrivate.PrefType.BOOLEAN, | 58 type: chrome.settingsPrivate.PrefType.BOOLEAN, |
| 51 value: true, | 59 value: false, |
| 52 }, | 60 }, |
| 53 natural_scroll: { | 61 natural_scroll: { |
| 54 key: 'settings.touchpad.natural_scroll', | 62 key: 'settings.touchpad.natural_scroll', |
| 55 type: chrome.settingsPrivate.PrefType.BOOLEAN, | 63 type: chrome.settingsPrivate.PrefType.BOOLEAN, |
| 56 value: false, | 64 value: false, |
| 57 }, | 65 }, |
| 66 sensitivity2: { | |
| 67 key: 'settings.touchpad.sensitivity2', | |
| 68 type: chrome.settingsPrivate.PrefType.NUMBER, | |
| 69 value: 3, | |
| 70 }, | |
| 71 }, | |
| 72 mouse: { | |
| 73 primary_right: { | |
| 74 key: 'settings.mouse.primary_right', | |
| 75 type: chrome.settingsPrivate.PrefType.BOOLEAN, | |
| 76 value: false, | |
| 77 }, | |
| 78 sensitivity2: { | |
| 79 key: 'settings.mouse.sensitivity2', | |
| 80 type: chrome.settingsPrivate.PrefType.NUMBER, | |
| 81 value: 4, | |
| 82 }, | |
| 58 }, | 83 }, |
| 59 language: { | 84 language: { |
| 60 xkb_remap_search_key_to: { | 85 xkb_remap_search_key_to: { |
| 61 key: 'settings.language.xkb_remap_search_key_to', | 86 key: 'settings.language.xkb_remap_search_key_to', |
| 62 type: chrome.settingsPrivate.PrefType.NUMBER, | 87 type: chrome.settingsPrivate.PrefType.NUMBER, |
| 63 value: 0, | 88 value: 0, |
| 64 }, | 89 }, |
| 65 xkb_remap_control_key_to: { | 90 xkb_remap_control_key_to: { |
| 66 key: 'settings.language.xkb_remap_control_key_to', | 91 key: 'settings.language.xkb_remap_control_key_to', |
| 67 type: chrome.settingsPrivate.PrefType.NUMBER, | 92 type: chrome.settingsPrivate.PrefType.NUMBER, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 98 value: 500, | 123 value: 500, |
| 99 }, | 124 }, |
| 100 xkb_auto_repeat_interval_r2: { | 125 xkb_auto_repeat_interval_r2: { |
| 101 key: 'settings.language.xkb_auto_repeat_interval_r2', | 126 key: 'settings.language.xkb_auto_repeat_interval_r2', |
| 102 type: chrome.settingsPrivate.PrefType.NUMBER, | 127 type: chrome.settingsPrivate.PrefType.NUMBER, |
| 103 value: 500, | 128 value: 500, |
| 104 }, | 129 }, |
| 105 } | 130 } |
| 106 } | 131 } |
| 107 }; | 132 }; |
| 133 } | |
| 108 | 134 |
| 135 suite('SettingsDevicePage', function() { | |
| 109 /** @type {!SettingsDevicePage|undefined} */ | 136 /** @type {!SettingsDevicePage|undefined} */ |
| 110 var devicePage; | 137 var devicePage; |
| 111 | 138 |
| 112 /** @type {!FakeSystemDisplay|undefined} */ | 139 /** @type {!FakeSystemDisplay|undefined} */ |
| 113 var fakeSystemDisplay; | 140 var fakeSystemDisplay; |
| 114 | 141 |
| 115 suiteSetup(function() { | 142 suiteSetup(function() { |
| 116 // Disable animations so sub-pages open within one event loop. | 143 // Disable animations so sub-pages open within one event loop. |
| 117 testing.Test.disableAnimationsAndTransitions(); | 144 testing.Test.disableAnimationsAndTransitions(); |
| 118 }); | 145 }); |
| 119 | 146 |
| 120 setup(function(done) { | 147 setup(function(done) { |
| 121 fakeSystemDisplay = new settings.FakeSystemDisplay(); | 148 fakeSystemDisplay = new settings.FakeSystemDisplay(); |
| 122 settings.display.systemDisplayApi = fakeSystemDisplay; | 149 settings.display.systemDisplayApi = fakeSystemDisplay; |
| 123 | 150 |
| 124 PolymerTest.clearBody(); | 151 PolymerTest.clearBody(); |
| 125 devicePage = document.createElement('settings-device-page'); | 152 devicePage = document.createElement('settings-device-page'); |
| 126 devicePage.currentRoute = {page: 'basic', section: '', subpage: []}; | 153 devicePage.currentRoute = {page: 'basic', section: '', subpage: []}; |
| 127 devicePage.prefs = fakePrefs; | 154 devicePage.prefs = getFakePrefs(); |
| 128 settings.DevicePageBrowserProxyImpl.instance_ = | 155 settings.DevicePageBrowserProxyImpl.instance_ = |
| 129 new TestDevicePageBrowserProxy(); | 156 new TestDevicePageBrowserProxy(); |
| 130 document.body.appendChild(devicePage); | 157 |
| 158 // settings-animated-pages expects a parent with data-page set. | |
| 159 var basicPage = document.createElement('div'); | |
| 160 basicPage.dataset.page = 'basic'; | |
| 161 basicPage.appendChild(devicePage); | |
| 162 document.body.appendChild(basicPage); | |
| 131 | 163 |
| 132 // Allow the light DOM to be distributed to settings-animated-pages. | 164 // Allow the light DOM to be distributed to settings-animated-pages. |
| 133 setTimeout(done); | 165 setTimeout(done); |
| 134 }); | 166 }); |
| 135 | 167 |
| 136 /** @return {!Promise<!Element>} */ | 168 /** @return {!Promise<!HTMLElement>} */ |
| 137 function showAndGetDeviceSubpage(subpage) { | 169 function showAndGetDeviceSubpage(subpage) { |
| 138 Polymer.dom.flush(); | |
| 139 var row = devicePage.$$('#main #' + subpage + 'Row'); | |
| 140 assertTrue(!!row); | |
| 141 MockInteractions.tap(row); | |
| 142 | |
| 143 // The 0-duration animation still requires flushing the task queue. | |
| 144 return new Promise(function(resolve, reject) { | 170 return new Promise(function(resolve, reject) { |
| 145 expectEquals('device', devicePage.currentRoute.section); | 171 var row = assert(devicePage.$$('#main #' + subpage + 'Row')); |
| 146 expectEquals(subpage, devicePage.currentRoute.subpage[0]); | 172 devicePage.$.pages.addEventListener('neon-animation-finish', resolve); |
| 173 MockInteractions.tap(row); | |
| 174 }).then(function() { | |
| 175 assertEquals('device', devicePage.currentRoute.section); | |
| 176 assertEquals(subpage, devicePage.currentRoute.subpage[0]); | |
| 147 var page = devicePage.$$('#' + subpage + ' settings-' + subpage); | 177 var page = devicePage.$$('#' + subpage + ' settings-' + subpage); |
| 148 assertTrue(!!page); | 178 return assert(page); |
| 149 setTimeout(function() { | |
| 150 resolve(page); | |
| 151 }); | |
| 152 }); | 179 }); |
| 153 }; | 180 }; |
| 154 | 181 |
| 155 /** | 182 /** |
| 156 * @param {!HTMLElement} touchpadPage | 183 * @param {!HTMLElement} pointersPage |
| 157 * @param {Boolean} expected | 184 * @param {Boolean} expected |
| 158 */ | 185 */ |
| 159 function expectNaturalScrollValue(touchpadPage, expected) { | 186 function expectNaturalScrollValue(pointersPage, expected) { |
| 160 var naturalScrollOff = | 187 var naturalScrollOff = |
| 161 touchpadPage.$$('paper-radio-button[name="false"]'); | 188 pointersPage.$$('paper-radio-button[name="false"]'); |
| 162 var naturalScrollOn = | 189 var naturalScrollOn = |
| 163 touchpadPage.$$('paper-radio-button[name="true"]'); | 190 pointersPage.$$('paper-radio-button[name="true"]'); |
| 164 assertTrue(!!naturalScrollOff); | 191 assertTrue(!!naturalScrollOff); |
| 165 assertTrue(!!naturalScrollOn); | 192 assertTrue(!!naturalScrollOn); |
| 166 | 193 |
| 167 expectEquals(!expected, naturalScrollOff.checked); | 194 expectEquals(!expected, naturalScrollOff.checked); |
| 168 expectEquals(expected, naturalScrollOn.checked); | 195 expectEquals(expected, naturalScrollOn.checked); |
| 169 expectEquals(expected, | 196 expectEquals(expected, |
| 170 devicePage.prefs.settings.touchpad.natural_scroll.value); | 197 devicePage.prefs.settings.touchpad.natural_scroll.value); |
| 171 } | 198 } |
| 172 | 199 |
| 173 test(assert(TestNames.Touchpad), function(done) { | 200 test(assert(TestNames.DevicePage), function() { |
| 174 showAndGetDeviceSubpage('touchpad').then(function(touchpadPage) { | 201 expectLT(0, devicePage.$.pointersRow.offsetHeight); |
| 175 expectNaturalScrollValue(touchpadPage, false); | 202 expectLT(0, devicePage.$.keyboardRow.offsetHeight); |
| 203 expectLT(0, devicePage.$.displayRow.offsetHeight); | |
| 204 | |
| 205 cr.webUIListenerCallback('has-mouse-changed', false); | |
| 206 expectLT(0, devicePage.$.pointersRow.offsetHeight); | |
| 207 cr.webUIListenerCallback('has-touchpad-changed', false); | |
| 208 expectEquals(0, devicePage.$.pointersRow.offsetHeight); | |
| 209 cr.webUIListenerCallback('has-mouse-changed', true); | |
| 210 expectLT(0, devicePage.$.pointersRow.offsetHeight); | |
| 211 }); | |
| 212 | |
| 213 suite(assert(TestNames.Pointers), function() { | |
| 214 var pointersPage; | |
| 215 | |
| 216 setup(function() { | |
| 217 return showAndGetDeviceSubpage('pointers').then(function(page) { | |
| 218 pointersPage = page; | |
| 219 }); | |
| 220 }); | |
| 221 | |
| 222 test('subpage responds to pointer attach/detach', function() { | |
| 223 assertEquals('pointers', devicePage.currentRoute.subpage[0]); | |
| 224 assertTrue(devicePage.isCurrentRouteOnPointersPage_()); | |
| 225 assertLT(0, pointersPage.$.mouse.offsetHeight); | |
| 226 assertLT(0, pointersPage.$.touchpad.offsetHeight); | |
| 227 assertLT(0, pointersPage.$$('#mouse h2').offsetHeight); | |
| 228 assertLT(0, pointersPage.$$('#touchpad h2').offsetHeight); | |
| 229 | |
| 230 cr.webUIListenerCallback('has-touchpad-changed', false); | |
| 231 assertEquals('pointers', devicePage.currentRoute.subpage[0]); | |
| 232 assertLT(0, pointersPage.$.mouse.offsetHeight); | |
| 233 assertEquals(0, pointersPage.$.touchpad.offsetHeight); | |
| 234 assertEquals(0, pointersPage.$$('#mouse h2').offsetHeight); | |
| 235 assertEquals(0, pointersPage.$$('#touchpad h2').offsetHeight); | |
| 236 | |
| 237 // Wait for the transition back to the main page. | |
| 238 return new Promise(function(resolve, reject) { | |
| 239 devicePage.$.pages.addEventListener('neon-animation-finish', resolve); | |
|
stevenjb
2016/07/11 17:46:20
BTW, this seems like something we should implement
| |
| 240 | |
| 241 cr.webUIListenerCallback('has-mouse-changed', false); | |
| 242 }).then(function() { | |
| 243 assertEquals(0, devicePage.currentRoute.subpage.length); | |
| 244 assertEquals(0, devicePage.$$('#main #pointersRow').offsetHeight); | |
| 245 | |
| 246 cr.webUIListenerCallback('has-touchpad-changed', true); | |
| 247 assertLT(0, devicePage.$$('#main #pointersRow').offsetHeight); | |
| 248 return showAndGetDeviceSubpage('pointers'); | |
| 249 }).then(function(page) { | |
| 250 assertEquals(0, pointersPage.$.mouse.offsetHeight); | |
| 251 assertLT(0, pointersPage.$.touchpad.offsetHeight); | |
| 252 assertEquals(0, pointersPage.$$('#mouse h2').offsetHeight); | |
| 253 assertEquals(0, pointersPage.$$('#touchpad h2').offsetHeight); | |
| 254 | |
| 255 cr.webUIListenerCallback('has-mouse-changed', true); | |
| 256 assertEquals('pointers', devicePage.currentRoute.subpage[0]); | |
| 257 assertLT(0, pointersPage.$.mouse.offsetHeight); | |
| 258 assertLT(0, pointersPage.$.touchpad.offsetHeight); | |
| 259 assertLT(0, pointersPage.$$('#mouse h2').offsetHeight); | |
| 260 assertLT(0, pointersPage.$$('#touchpad h2').offsetHeight); | |
| 261 }); | |
| 262 }); | |
| 263 | |
| 264 test('mouse', function() { | |
| 265 expectLT(0, pointersPage.$.mouse.offsetHeight); | |
| 266 | |
| 267 expectFalse(pointersPage.$$('#mouse settings-checkbox').checked); | |
| 268 | |
| 269 var slider = assert(pointersPage.$$('#mouse cr-slider')); | |
| 270 expectEquals(4, slider.value); | |
| 271 MockInteractions.pressAndReleaseKeyOn(slider.$.slider, 37 /* left */); | |
| 272 expectEquals(3, devicePage.prefs.settings.mouse.sensitivity2.value); | |
| 273 | |
| 274 pointersPage.set('prefs.settings.mouse.sensitivity2.value', 5); | |
| 275 expectEquals(5, slider.value); | |
| 276 }); | |
| 277 | |
| 278 test('touchpad', function() { | |
| 279 expectLT(0, pointersPage.$.touchpad.offsetHeight); | |
| 280 | |
| 281 expectTrue(pointersPage.$$('#touchpad #enableTapToClick').checked); | |
| 282 expectFalse(pointersPage.$$('#touchpad #enableTapDragging').checked); | |
| 283 | |
| 284 var slider = assert(pointersPage.$$('#touchpad cr-slider')); | |
| 285 expectEquals(3, slider.value); | |
| 286 MockInteractions.pressAndReleaseKeyOn( | |
| 287 slider.$.slider, 39 /* right */); | |
| 288 expectEquals(4, devicePage.prefs.settings.touchpad.sensitivity2.value); | |
| 289 | |
| 290 pointersPage.set('prefs.settings.touchpad.sensitivity2.value', 2); | |
| 291 expectEquals(2, slider.value); | |
| 292 }); | |
| 293 | |
| 294 test('link doesn\'t activate control', function(done) { | |
| 295 expectNaturalScrollValue(pointersPage, false); | |
| 176 | 296 |
| 177 // Tapping the link shouldn't enable the radio button. | 297 // Tapping the link shouldn't enable the radio button. |
| 178 var naturalScrollOn = | 298 var naturalScrollOn = |
| 179 touchpadPage.$$('paper-radio-button[name="true"]'); | 299 pointersPage.$$('paper-radio-button[name="true"]'); |
| 180 var a = naturalScrollOn.querySelector('a'); | 300 var a = naturalScrollOn.querySelector('a'); |
| 181 | 301 |
| 182 MockInteractions.tap(a); | 302 MockInteractions.tap(a); |
| 183 expectNaturalScrollValue(touchpadPage, false); | 303 expectNaturalScrollValue(pointersPage, false); |
| 184 | 304 |
| 185 MockInteractions.tap(naturalScrollOn); | 305 MockInteractions.tap(naturalScrollOn); |
| 186 expectNaturalScrollValue(touchpadPage, true); | 306 expectNaturalScrollValue(pointersPage, true); |
| 187 | |
| 188 devicePage.set('prefs.settings.touchpad.natural_scroll.value', false); | 307 devicePage.set('prefs.settings.touchpad.natural_scroll.value', false); |
| 189 expectNaturalScrollValue(touchpadPage, false); | 308 expectNaturalScrollValue(pointersPage, false); |
| 190 | 309 |
| 191 // Enter on the link shouldn't enable the radio button either. | 310 // Enter on the link shouldn't enable the radio button either. |
| 192 MockInteractions.pressEnter(a); | 311 MockInteractions.pressEnter(a); |
| 193 | 312 |
| 194 // Annoyingly, we have to schedule an async event with a timeout greater | 313 // Annoyingly, we have to schedule an async event with a timeout |
| 195 // than or equal to the timeout used by IronButtonState (1). | 314 // greater than or equal to the timeout used by IronButtonState (1). |
| 196 // https://github.com/PolymerElements/iron-behaviors/issues/54 | 315 // https://github.com/PolymerElements/iron-behaviors/issues/54 |
| 197 Polymer.Base.async(function() { | 316 Polymer.Base.async(function() { |
| 198 expectNaturalScrollValue(touchpadPage, false); | 317 expectNaturalScrollValue(pointersPage, false); |
| 199 | 318 |
| 200 MockInteractions.pressEnter(naturalScrollOn); | 319 MockInteractions.pressEnter(naturalScrollOn); |
| 201 Polymer.Base.async(function() { | 320 Polymer.Base.async(function() { |
| 202 expectNaturalScrollValue(touchpadPage, true); | 321 expectNaturalScrollValue(pointersPage, true); |
| 203 done(); | 322 done(); |
| 204 }, 1); | 323 }, 1); |
| 205 }, 1); | 324 }, 1); |
| 206 }); | 325 }); |
| 207 }); | 326 }); |
| 208 | 327 |
| 209 test(assert(TestNames.Keyboard), function() { | 328 test(assert(TestNames.Keyboard), function() { |
| 210 // Open the keyboard subpage. | 329 // Open the keyboard subpage. |
| 211 return showAndGetDeviceSubpage('keyboard').then(function(keyboardPage) { | 330 return showAndGetDeviceSubpage('keyboard').then(function(keyboardPage) { |
| 212 // Initially, the optional keys are hidden. | 331 // Initially, the optional keys are hidden. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 235 expectTrue(collapse.opened); | 354 expectTrue(collapse.opened); |
| 236 | 355 |
| 237 expectEquals(500, keyboardPage.$.delaySlider.value); | 356 expectEquals(500, keyboardPage.$.delaySlider.value); |
| 238 expectEquals(500, keyboardPage.$.repeatRateSlider.value); | 357 expectEquals(500, keyboardPage.$.repeatRateSlider.value); |
| 239 | 358 |
| 240 // Test interaction with the cr-slider's underlying paper-slider. | 359 // Test interaction with the cr-slider's underlying paper-slider. |
| 241 MockInteractions.pressAndReleaseKeyOn( | 360 MockInteractions.pressAndReleaseKeyOn( |
| 242 keyboardPage.$.delaySlider.$.slider, 37 /* left */); | 361 keyboardPage.$.delaySlider.$.slider, 37 /* left */); |
| 243 MockInteractions.pressAndReleaseKeyOn( | 362 MockInteractions.pressAndReleaseKeyOn( |
| 244 keyboardPage.$.repeatRateSlider.$.slider, 39 /* right */); | 363 keyboardPage.$.repeatRateSlider.$.slider, 39 /* right */); |
| 245 expectEquals( | 364 expectEquals(1000, |
| 246 1000, fakePrefs.settings.language.xkb_auto_repeat_delay_r2.value); | 365 devicePage.prefs.settings.language.xkb_auto_repeat_delay_r2.value); |
| 247 expectEquals( | 366 expectEquals( |
| 248 300, | 367 300, |
| 249 fakePrefs.settings.language.xkb_auto_repeat_interval_r2.value); | 368 devicePage.prefs.settings.language.xkb_auto_repeat_interval_r2.value |
| 369 ); | |
| 250 | 370 |
| 251 // Test sliders change when prefs change. | 371 // Test sliders change when prefs change. |
| 252 devicePage.set( | 372 devicePage.set( |
| 253 'prefs.settings.language.xkb_auto_repeat_delay_r2.value', 1500); | 373 'prefs.settings.language.xkb_auto_repeat_delay_r2.value', 1500); |
| 254 expectEquals(1500, keyboardPage.$.delaySlider.value); | 374 expectEquals(1500, keyboardPage.$.delaySlider.value); |
| 255 devicePage.set( | 375 devicePage.set( |
| 256 'prefs.settings.language.xkb_auto_repeat_interval_r2.value', | 376 'prefs.settings.language.xkb_auto_repeat_interval_r2.value', |
| 257 2000); | 377 2000); |
| 258 expectEquals(2000, keyboardPage.$.repeatRateSlider.value); | 378 expectEquals(2000, keyboardPage.$.repeatRateSlider.value); |
| 259 | 379 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 273 // Test keyboard shortcut overlay button. | 393 // Test keyboard shortcut overlay button. |
| 274 MockInteractions.tap(keyboardPage.$$('#keyboardOverlay')); | 394 MockInteractions.tap(keyboardPage.$$('#keyboardOverlay')); |
| 275 expectEquals( | 395 expectEquals( |
| 276 1, | 396 1, |
| 277 settings.DevicePageBrowserProxyImpl.getInstance() | 397 settings.DevicePageBrowserProxyImpl.getInstance() |
| 278 .keyboardShortcutsOverlayShown_); | 398 .keyboardShortcutsOverlayShown_); |
| 279 }); | 399 }); |
| 280 }); | 400 }); |
| 281 | 401 |
| 282 test(assert(TestNames.Display), function() { | 402 test(assert(TestNames.Display), function() { |
| 283 // Open the display subpage. | |
| 284 var displayPage = showAndGetDeviceSubpage('display'); | |
| 285 assertTrue(!!displayPage); | |
| 286 | |
| 287 var addDisplay = function(n) { | 403 var addDisplay = function(n) { |
| 288 var display = { | 404 var display = { |
| 289 id: 'fakeDisplayId' + n, | 405 id: 'fakeDisplayId' + n, |
| 290 name: 'fakeDisplayName' + n, | 406 name: 'fakeDisplayName' + n, |
| 291 mirroring: '', | 407 mirroring: '', |
| 292 isPrimary: n == 1, | 408 isPrimary: n == 1, |
| 293 rotation: 0, | 409 rotation: 0, |
| 294 modes: [], | 410 modes: [], |
| 295 bounds: { | 411 bounds: { |
| 296 left: 0, | 412 left: 0, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 expectTrue(displayPage.showMirror_(displayPage.displays)); | 513 expectTrue(displayPage.showMirror_(displayPage.displays)); |
| 398 expectTrue(displayPage.isMirrored_(displayPage.displays)); | 514 expectTrue(displayPage.isMirrored_(displayPage.displays)); |
| 399 }); | 515 }); |
| 400 }); | 516 }); |
| 401 }); | 517 }); |
| 402 | 518 |
| 403 return { | 519 return { |
| 404 TestNames: TestNames | 520 TestNames: TestNames |
| 405 }; | 521 }; |
| 406 }); | 522 }); |
| OLD | NEW |