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

Side by Side Diff: chrome/test/data/webui/print_preview/print_preview_destination_search_test.js

Issue 2969383003: Print Preview: Finish removing global Javascript functions. (Closed)
Patch Set: Clean up Created 3 years, 5 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 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
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 });
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698