Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/test/data/webui/settings/fake_system_display.js

Issue 2802603005: MD Settings: Display: Add unified desktop control and modify api (Closed)
Patch Set: Fix closure and tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/device_page_tests.js ('k') | extensions/browser/api/system_display/display_info_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698