| 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 {TestBrowserProxy} | 9 * @extends {TestBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return Promise.resolve(true); | 91 return Promise.resolve(true); |
| 92 }, | 92 }, |
| 93 | 93 |
| 94 /** @override */ | 94 /** @override */ |
| 95 getPrinterCapabilities: function(printerId) { | 95 getPrinterCapabilities: function(printerId) { |
| 96 this.methodCalled('getPrinterCapabilities', printerId); | 96 this.methodCalled('getPrinterCapabilities', printerId); |
| 97 return this.localDestinationCapabilities_.get(printerId); | 97 return this.localDestinationCapabilities_.get(printerId); |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 /** @override */ | 100 /** @override */ |
| 101 print: function() { | 101 print: function( |
| 102 this.methodCalled('print'); | 102 destination, printTicketStore, cloudPrintInterface, documentInfo) { |
| 103 this.methodCalled('print', { |
| 104 destination: destination, |
| 105 printTicketStore: printTicketStore, |
| 106 cloudPrintInterface: cloudPrintInterface, |
| 107 documentInfo: documentInfo, |
| 108 }); |
| 103 return Promise.resolve(); | 109 return Promise.resolve(); |
| 104 }, | 110 }, |
| 105 | 111 |
| 106 /** @override */ | 112 /** @override */ |
| 107 setupPrinter: function(printerId) { | 113 setupPrinter: function(printerId) { |
| 108 this.methodCalled('setupPrinter', printerId); | 114 this.methodCalled('setupPrinter', printerId); |
| 109 return this.shouldRejectPrinterSetup_ ? | 115 return this.shouldRejectPrinterSetup_ ? |
| 110 Promise.reject(this.setupPrinterResponse_) : | 116 Promise.reject(this.setupPrinterResponse_) : |
| 111 Promise.resolve(this.setupPrinterResponse_); | 117 Promise.resolve(this.setupPrinterResponse_); |
| 112 }, | 118 }, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 setSetupPrinterResponse: function(reject, response) { | 173 setSetupPrinterResponse: function(reject, response) { |
| 168 this.shouldRejectPrinterSetup_ = reject; | 174 this.shouldRejectPrinterSetup_ = reject; |
| 169 this.setupPrinterResponse_ = response; | 175 this.setupPrinterResponse_ = response; |
| 170 }, | 176 }, |
| 171 }; | 177 }; |
| 172 | 178 |
| 173 return { | 179 return { |
| 174 NativeLayerStub: NativeLayerStub, | 180 NativeLayerStub: NativeLayerStub, |
| 175 }; | 181 }; |
| 176 }); | 182 }); |
| OLD | NEW |