| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // orientation of the second display. | 469 // orientation of the second display. |
| 470 var displayLayout = displayPage.$$('#displayLayout'); | 470 var displayLayout = displayPage.$$('#displayLayout'); |
| 471 assertTrue(!!displayLayout); | 471 assertTrue(!!displayLayout); |
| 472 var displayDiv = displayLayout.$$('#_fakeDisplayId2'); | 472 var displayDiv = displayLayout.$$('#_fakeDisplayId2'); |
| 473 assertTrue(!!displayDiv); | 473 assertTrue(!!displayDiv); |
| 474 MockInteractions.tap(displayDiv); | 474 MockInteractions.tap(displayDiv); |
| 475 expectEquals( | 475 expectEquals( |
| 476 displayPage.displays[1].id, displayPage.selectedDisplay.id); | 476 displayPage.displays[1].id, displayPage.selectedDisplay.id); |
| 477 | 477 |
| 478 displayPage.onMakePrimaryTap_(); | 478 displayPage.onMakePrimaryTap_(); |
| 479 displayPage.onSetOrientation_({detail: {selected: '90'}}); | 479 displayPage.onOrientationChange_({target: {value: '90'}}); |
| 480 fakeSystemDisplay.onDisplayChanged.callListeners(); | 480 fakeSystemDisplay.onDisplayChanged.callListeners(); |
| 481 | 481 |
| 482 return Promise.all([ | 482 return Promise.all([ |
| 483 fakeSystemDisplay.getInfoCalled.promise, | 483 fakeSystemDisplay.getInfoCalled.promise, |
| 484 fakeSystemDisplay.getLayoutCalled.promise, | 484 fakeSystemDisplay.getLayoutCalled.promise, |
| 485 new Promise(function(resolve, reject) { setTimeout(resolve); }) | 485 new Promise(function(resolve, reject) { setTimeout(resolve); }) |
| 486 ]); | 486 ]); |
| 487 }).then(function() { | 487 }).then(function() { |
| 488 // Confirm that the second display is selected, primary, and rotated. | 488 // Confirm that the second display is selected, primary, and rotated. |
| 489 expectEquals(2, displayPage.displays.length); | 489 expectEquals(2, displayPage.displays.length); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 512 expectTrue(displayPage.showMirror_(displayPage.displays)); | 512 expectTrue(displayPage.showMirror_(displayPage.displays)); |
| 513 expectTrue(displayPage.isMirrored_(displayPage.displays)); | 513 expectTrue(displayPage.isMirrored_(displayPage.displays)); |
| 514 }); | 514 }); |
| 515 }); | 515 }); |
| 516 }); | 516 }); |
| 517 | 517 |
| 518 return { | 518 return { |
| 519 TestNames: TestNames | 519 TestNames: TestNames |
| 520 }; | 520 }; |
| 521 }); | 521 }); |
| OLD | NEW |