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 DevicePage: 'device page', |
9 Display: 'display', | 9 Display: 'display', |
10 Keyboard: 'keyboard', | 10 Keyboard: 'keyboard', |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // Wait for the initial call to getInfo. | 433 // Wait for the initial call to getInfo. |
434 fakeSystemDisplay.getInfoCalled.promise, | 434 fakeSystemDisplay.getInfoCalled.promise, |
435 ]).then(function() { | 435 ]).then(function() { |
436 // Add a display. | 436 // Add a display. |
437 addDisplay(1); | 437 addDisplay(1); |
438 fakeSystemDisplay.onDisplayChanged.callListeners(); | 438 fakeSystemDisplay.onDisplayChanged.callListeners(); |
439 | 439 |
440 return Promise.all([ | 440 return Promise.all([ |
441 fakeSystemDisplay.getInfoCalled.promise, | 441 fakeSystemDisplay.getInfoCalled.promise, |
442 fakeSystemDisplay.getLayoutCalled.promise, | 442 fakeSystemDisplay.getLayoutCalled.promise, |
443 new Promise(function(resolve, reject) { setTimeout(resolve); }) | |
444 ]); | 443 ]); |
445 }).then(function() { | 444 }).then(function() { |
446 // There should be a single display which should be primary and | 445 // There should be a single display which should be primary and |
447 // selected. Mirroring should be disabled. | 446 // selected. Mirroring should be disabled. |
448 expectEquals(1, displayPage.displays.length); | 447 expectEquals(1, displayPage.displays.length); |
449 expectEquals( | 448 expectEquals( |
450 displayPage.displays[0].id, displayPage.selectedDisplay.id); | 449 displayPage.displays[0].id, displayPage.selectedDisplay.id); |
451 expectEquals( | 450 expectEquals( |
452 displayPage.displays[0].id, displayPage.primaryDisplayId); | 451 displayPage.displays[0].id, displayPage.primaryDisplayId); |
453 expectFalse(displayPage.showMirror_(displayPage.displays)); | 452 expectFalse(displayPage.showMirror_(displayPage.displays)); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 expectTrue(displayPage.showMirror_(displayPage.displays)); | 518 expectTrue(displayPage.showMirror_(displayPage.displays)); |
520 expectTrue(displayPage.isMirrored_(displayPage.displays)); | 519 expectTrue(displayPage.isMirrored_(displayPage.displays)); |
521 }); | 520 }); |
522 }); | 521 }); |
523 }); | 522 }); |
524 | 523 |
525 return { | 524 return { |
526 TestNames: TestNames | 525 TestNames: TestNames |
527 }; | 526 }; |
528 }); | 527 }); |
OLD | NEW |