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

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

Issue 2956033002: Print Preview: Make useCloudPrint a WebUI event (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 cr.define('print_preview_test', function() { 5 cr.define('print_preview_test', function() {
6 /** 6 /**
7 * Index of the "Save as PDF" printer. 7 * Index of the "Save as PDF" printer.
8 * @type {number} 8 * @type {number}
9 * @const 9 * @const
10 */ 10 */
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 'BarName', 305 'BarName',
306 localList.childNodes.item(BAR_INDEX). 306 localList.childNodes.item(BAR_INDEX).
307 querySelector('.destination-list-item-name').textContent); 307 querySelector('.destination-list-item-name').textContent);
308 }); 308 });
309 }); 309 });
310 310
311 // Test that the printer list is structured correctly after calling 311 // Test that the printer list is structured correctly after calling
312 // addCloudPrinters with an empty list. 312 // addCloudPrinters with an empty list.
313 test('PrinterListCloudEmpty', function() { 313 test('PrinterListCloudEmpty', function() {
314 return setupSettingsAndDestinationsWithCapabilities().then(function() { 314 return setupSettingsAndDestinationsWithCapabilities().then(function() {
315 var cloudPrintEnableEvent = new Event( 315 cr.webUIListenerCallback('use-cloud-print', 'cloudprint url', false);
316 print_preview.NativeLayer.EventType.CLOUD_PRINT_ENABLE);
317 cloudPrintEnableEvent.baseCloudPrintUrl = 'cloudprint url';
318 nativeLayer.getEventTarget().dispatchEvent(
319 cloudPrintEnableEvent);
320
321 var searchDoneEvent = 316 var searchDoneEvent =
322 new Event(cloudprint.CloudPrintInterfaceEventType.SEARCH_DONE); 317 new Event(cloudprint.CloudPrintInterfaceEventType.SEARCH_DONE);
323 searchDoneEvent.printers = []; 318 searchDoneEvent.printers = [];
324 searchDoneEvent.isRecent = true; 319 searchDoneEvent.isRecent = true;
325 searchDoneEvent.email = 'foo@chromium.org'; 320 searchDoneEvent.email = 'foo@chromium.org';
326 printPreview.cloudPrintInterface_.dispatchEvent(searchDoneEvent); 321 printPreview.cloudPrintInterface_.dispatchEvent(searchDoneEvent);
327 322
328 var recentList = 323 var recentList =
329 $('destination-search').querySelector('.recent-list ul'); 324 $('destination-search').querySelector('.recent-list ul');
330 var localList = 325 var localList =
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 return setupSettingsAndDestinationsWithCapabilities().then(function() { 1363 return setupSettingsAndDestinationsWithCapabilities().then(function() {
1369 // The system default destination should be used instead of the 1364 // The system default destination should be used instead of the
1370 // most recent destination. 1365 // most recent destination.
1371 assertEquals( 1366 assertEquals(
1372 'FooDevice', 1367 'FooDevice',
1373 printPreview.destinationStore_.selectedDestination.id); 1368 printPreview.destinationStore_.selectedDestination.id);
1374 }); 1369 });
1375 }); 1370 });
1376 }); 1371 });
1377 }); 1372 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698