| 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 /** | 5 /** |
| 6 * @fileoverview Fake implementation of chrome.system.display for testing. | 6 * @fileoverview Fake implementation of chrome.system.display for testing. |
| 7 */ | 7 */ |
| 8 cr.define('settings', function() { | 8 cr.define('settings', function() { |
| 9 /** | 9 /** |
| 10 * Fake of the chrome.settings.display API. | 10 * Fake of the chrome.settings.display API. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 /** | 24 /** |
| 25 * @param {!chrome.system.display.DisplayUnitInfo>} display | 25 * @param {!chrome.system.display.DisplayUnitInfo>} display |
| 26 */ | 26 */ |
| 27 addDisplayForTest: function(display) { | 27 addDisplayForTest: function(display) { |
| 28 this.fakeDisplays.push(display); | 28 this.fakeDisplays.push(display); |
| 29 this.updateLayouts_(); | 29 this.updateLayouts_(); |
| 30 }, | 30 }, |
| 31 | 31 |
| 32 // SystemDisplay overrides. | 32 // SystemDisplay overrides. |
| 33 /** @override */ | 33 /** @override */ |
| 34 getInfo: function(callback) { | 34 getInfo: function(flags, callback) { |
| 35 setTimeout(function() { | 35 setTimeout(function() { |
| 36 // Create a shallow copy to trigger Polymer data binding updates. | 36 // Create a shallow copy to trigger Polymer data binding updates. |
| 37 var displays; | 37 var displays; |
| 38 if (this.fakeDisplays.length > 0 && | 38 if (this.fakeDisplays.length > 0 && |
| 39 this.fakeDisplays[0].mirroringSourceId) { | 39 this.fakeDisplays[0].mirroringSourceId) { |
| 40 // When mirroring is enabled, send only the info for the display | 40 // When mirroring is enabled, send only the info for the display |
| 41 // being mirrored. | 41 // being mirrored. |
| 42 var display = | 42 var display = |
| 43 this.getFakeDisplay_(this.fakeDisplays[0].mirroringSourceId); | 43 this.getFakeDisplay_(this.fakeDisplays[0].mirroringSourceId); |
| 44 assert(!!display); | 44 assert(!!display); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 parentId: d.isPrimary ? '' : primaryId, | 130 parentId: d.isPrimary ? '' : primaryId, |
| 131 position: chrome.system.display.LayoutPosition.RIGHT, | 131 position: chrome.system.display.LayoutPosition.RIGHT, |
| 132 offset: 0 | 132 offset: 0 |
| 133 }); | 133 }); |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 return {FakeSystemDisplay: FakeSystemDisplay}; | 138 return {FakeSystemDisplay: FakeSystemDisplay}; |
| 139 }); | 139 }); |
| OLD | NEW |