| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 // Wait for the initial call to getInfo. | 427 // Wait for the initial call to getInfo. |
| 428 fakeSystemDisplay.getInfoCalled.promise, | 428 fakeSystemDisplay.getInfoCalled.promise, |
| 429 ]).then(function() { | 429 ]).then(function() { |
| 430 // Add a display. | 430 // Add a display. |
| 431 addDisplay(1); | 431 addDisplay(1); |
| 432 fakeSystemDisplay.onDisplayChanged.callListeners(); | 432 fakeSystemDisplay.onDisplayChanged.callListeners(); |
| 433 | 433 |
| 434 return Promise.all([ | 434 return Promise.all([ |
| 435 fakeSystemDisplay.getInfoCalled.promise, | 435 fakeSystemDisplay.getInfoCalled.promise, |
| 436 fakeSystemDisplay.getLayoutCalled.promise, | 436 fakeSystemDisplay.getLayoutCalled.promise, |
| 437 new Promise(function(resolve, reject) { setTimeout(resolve); }) | |
| 438 ]); | 437 ]); |
| 439 }).then(function() { | 438 }).then(function() { |
| 440 // There should be a single display which should be primary and | 439 // There should be a single display which should be primary and |
| 441 // selected. Mirroring should be disabled. | 440 // selected. Mirroring should be disabled. |
| 442 expectEquals(1, displayPage.displays.length); | 441 expectEquals(1, displayPage.displays.length); |
| 443 expectEquals( | 442 expectEquals( |
| 444 displayPage.displays[0].id, displayPage.selectedDisplay.id); | 443 displayPage.displays[0].id, displayPage.selectedDisplay.id); |
| 445 expectEquals( | 444 expectEquals( |
| 446 displayPage.displays[0].id, displayPage.primaryDisplayId); | 445 displayPage.displays[0].id, displayPage.primaryDisplayId); |
| 447 expectFalse(displayPage.showMirror_(displayPage.displays)); | 446 expectFalse(displayPage.showMirror_(displayPage.displays)); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 expectTrue(displayPage.showMirror_(displayPage.displays)); | 512 expectTrue(displayPage.showMirror_(displayPage.displays)); |
| 514 expectTrue(displayPage.isMirrored_(displayPage.displays)); | 513 expectTrue(displayPage.isMirrored_(displayPage.displays)); |
| 515 }); | 514 }); |
| 516 }); | 515 }); |
| 517 }); | 516 }); |
| 518 | 517 |
| 519 return { | 518 return { |
| 520 TestNames: TestNames | 519 TestNames: TestNames |
| 521 }; | 520 }; |
| 522 }); | 521 }); |
| OLD | NEW |