OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 /** | 6 /** |
7 * Test version of the native layer. | 7 * Test version of the native layer. |
8 * @constructor | 8 * @constructor |
9 * @extends {settings.TestBrowserProxy} | 9 * @extends {test.TestBrowserProxy} |
10 */ | 10 */ |
11 function NativeLayerStub() { | 11 function NativeLayerStub() { |
12 settings.TestBrowserProxy.call(this, [ | 12 test.TestBrowserProxy.call(this, [ |
13 'getInitialSettings', 'getPrinters', 'setupPrinter' ]); | 13 'getInitialSettings', 'getPrinters', 'setupPrinter' ]); |
14 | 14 |
15 /** | 15 /** |
16 * @private {!cr.EventTarget} The event target used for dispatching and | 16 * @private {!cr.EventTarget} The event target used for dispatching and |
17 * receiving events. | 17 * receiving events. |
18 */ | 18 */ |
19 this.eventTarget_ = new cr.EventTarget(); | 19 this.eventTarget_ = new cr.EventTarget(); |
20 | 20 |
21 /** @private {boolean} Whether the native layer has sent a print message. */ | 21 /** @private {boolean} Whether the native layer has sent a print message. */ |
22 this.printStarted_ = false; | 22 this.printStarted_ = false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 this.destinationToWatch_ = ''; | 58 this.destinationToWatch_ = ''; |
59 | 59 |
60 /** | 60 /** |
61 * @private {number} The number of calls to | 61 * @private {number} The number of calls to |
62 * |getLocalDestinationCapabilities| with id = |destinationToWatch_|. | 62 * |getLocalDestinationCapabilities| with id = |destinationToWatch_|. |
63 */ | 63 */ |
64 this.getLocalDestinationCapabilitiesCallCount_ = 0; | 64 this.getLocalDestinationCapabilitiesCallCount_ = 0; |
65 } | 65 } |
66 | 66 |
67 NativeLayerStub.prototype = { | 67 NativeLayerStub.prototype = { |
68 __proto__: settings.TestBrowserProxy.prototype, | 68 __proto__: test.TestBrowserProxy.prototype, |
69 | 69 |
70 /** @override */ | 70 /** @override */ |
71 getInitialSettings: function() { | 71 getInitialSettings: function() { |
72 this.methodCalled('getInitialSettings'); | 72 this.methodCalled('getInitialSettings'); |
73 return Promise.resolve(this.initialSettings_); | 73 return Promise.resolve(this.initialSettings_); |
74 }, | 74 }, |
75 | 75 |
76 /** @override */ | 76 /** @override */ |
77 getPrinters: function() { | 77 getPrinters: function() { |
78 this.methodCalled('getPrinters'); | 78 this.methodCalled('getPrinters'); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 setSetupPrinterResponse: function(reject, response) { | 160 setSetupPrinterResponse: function(reject, response) { |
161 this.shouldRejectPrinterSetup_ = reject; | 161 this.shouldRejectPrinterSetup_ = reject; |
162 this.setupPrinterResponse_ = response; | 162 this.setupPrinterResponse_ = response; |
163 }, | 163 }, |
164 }; | 164 }; |
165 | 165 |
166 return { | 166 return { |
167 NativeLayerStub: NativeLayerStub, | 167 NativeLayerStub: NativeLayerStub, |
168 }; | 168 }; |
169 }); | 169 }); |
OLD | NEW |