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 var ROOT_PATH = '../../../../../'; | 5 var ROOT_PATH = '../../../../../'; |
6 | 6 |
7 GEN_INCLUDE( | 7 GEN_INCLUDE( |
8 [ROOT_PATH + 'chrome/test/data/webui/polymer_browser_test_base.js']); | 8 [ROOT_PATH + 'chrome/test/data/webui/polymer_browser_test_base.js']); |
9 | 9 |
10 /** | 10 /** |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 | 117 |
118 // Select destination. | 118 // Select destination. |
119 if (cr.isChromeOS) { | 119 if (cr.isChromeOS) { |
120 destinationSearch.handleConfigureDestination_(dest); | 120 destinationSearch.handleConfigureDestination_(dest); |
121 } else { | 121 } else { |
122 destinationSearch.handleOnDestinationSelect_(dest); | 122 destinationSearch.handleOnDestinationSelect_(dest); |
123 } | 123 } |
124 }; | 124 }; |
125 | 125 |
126 setup(function() { | 126 setup(function() { |
127 Mock4JS.clearMocksToVerify(); | 127 Mock4JS.clearMocksToVerify(); |
dpapad
2017/07/07 21:12:41
Can we delete this now? Or is it still used?
rbpotter
2017/07/07 23:58:39
Done. Appears there are no other mocks.
Also remo
| |
128 nativeLayer_ = new print_preview.NativeLayerStub(); | 128 nativeLayer_ = new print_preview.NativeLayerStub(); |
129 var nativeLayerEventTarget = mock(cr.EventTarget); | |
130 nativeLayer_.setEventTarget(nativeLayerEventTarget.proxy()); | |
131 nativeLayerEventTarget.expects(atLeastOnce()) | |
132 .addEventListener(ANYTHING, ANYTHING, ANYTHING); | |
133 | |
134 invitationStore_ = new print_preview.InvitationStore(); | 129 invitationStore_ = new print_preview.InvitationStore(); |
135 destinationStore_ = new print_preview.DestinationStore( | 130 destinationStore_ = new print_preview.DestinationStore( |
136 nativeLayer_, new print_preview.UserInfo(), | 131 nativeLayer_, new print_preview.UserInfo(), |
137 new print_preview.AppState()); | 132 new print_preview.AppState()); |
138 userInfo_ = new print_preview.UserInfo(); | 133 userInfo_ = new print_preview.UserInfo(); |
139 | 134 |
140 destinationSearch_ = new print_preview.DestinationSearch( | 135 destinationSearch_ = new print_preview.DestinationSearch( |
141 destinationStore_, invitationStore_, userInfo_); | 136 destinationStore_, invitationStore_, userInfo_); |
142 destinationSearch_.decorate($('destination-search')); | 137 destinationSearch_.decorate($('destination-search')); |
143 }); | 138 }); |
144 | 139 |
145 teardown(function() { | 140 teardown(function() { |
146 Mock4JS.verifyAllMocks(); | 141 Mock4JS.verifyAllMocks(); |
147 }); | 142 }); |
148 | 143 |
149 test('ResolutionFails', function() { | 144 test('ResolutionFails', function() { |
150 var destId = "001122DEADBEEF"; | 145 var destId = "001122DEADBEEF"; |
151 if (cr.isChromeOS) { | 146 if (cr.isChromeOS) { |
dpapad
2017/07/07 21:12:41
Same question here.
rbpotter
2017/07/07 23:58:39
This is still used to distinguish ChromeOS (which
| |
152 nativeLayer_.setSetupPrinterResponse(true, { printerId: destId, | 147 nativeLayer_.setSetupPrinterResponse(true, { printerId: destId, |
153 success: false,}); | 148 success: false,}); |
154 } else { | 149 } else { |
155 nativeLayer_.setLocalDestinationCapabilities({printerId: destId, | 150 nativeLayer_.setLocalDestinationCapabilities({printerId: destId, |
156 capabilities: getCaps()}, | 151 capabilities: getCaps()}, |
157 true); | 152 true); |
158 } | 153 } |
159 requestSetup(destId, destinationSearch_); | 154 requestSetup(destId, destinationSearch_); |
160 var callback = cr.isChromeOS ? 'setupPrinter' : 'getPrinterCapabilities'; | 155 var callback = cr.isChromeOS ? 'setupPrinter' : 'getPrinterCapabilities'; |
161 return nativeLayer_.whenCalled(callback).then( | 156 return nativeLayer_.whenCalled(callback).then( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 // Simulate a click. | 223 // Simulate a click. |
229 dest.onActivate_(); | 224 dest.onActivate_(); |
230 | 225 |
231 // Verify that the destination has been selected. | 226 // Verify that the destination has been selected. |
232 assertEquals(printerId, destinationStore_.selectedDestination.id); | 227 assertEquals(printerId, destinationStore_.selectedDestination.id); |
233 }); | 228 }); |
234 }); | 229 }); |
235 | 230 |
236 mocha.run(); | 231 mocha.run(); |
237 }); | 232 }); |
OLD | NEW |