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

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

Issue 2865633004: Fix all remaining print preview closure compiler errors (Closed)
Patch Set: Restore global printPreview for tests Created 3 years, 7 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
« no previous file with comments | « chrome/browser/resources/print_preview/settings/more_settings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 GEN('#include "base/feature_list.h"'); 5 GEN('#include "base/feature_list.h"');
6 GEN('#include "chrome/common/chrome_features.h"'); 6 GEN('#include "chrome/common/chrome_features.h"');
7 7
8 /** 8 /**
9 * Test fixture for print preview WebUI testing. 9 * Test fixture for print preview WebUI testing.
10 * @constructor 10 * @constructor
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 search: function(isRecent) {} 112 search: function(isRecent) {}
113 }; 113 };
114 var oldCpInterfaceEventType = cloudprint.CloudPrintInterfaceEventType; 114 var oldCpInterfaceEventType = cloudprint.CloudPrintInterfaceEventType;
115 cloudprint.CloudPrintInterface = CloudPrintInterfaceStub; 115 cloudprint.CloudPrintInterface = CloudPrintInterfaceStub;
116 cloudprint.CloudPrintInterfaceEventType = oldCpInterfaceEventType; 116 cloudprint.CloudPrintInterfaceEventType = oldCpInterfaceEventType;
117 117
118 print_preview.PreviewArea.prototype.checkPluginCompatibility_ = 118 print_preview.PreviewArea.prototype.checkPluginCompatibility_ =
119 function() { 119 function() {
120 return false; 120 return false;
121 }; 121 };
122
dpapad 2017/05/09 01:18:07 Nit: Maybe revert changes in this file for now?
rbpotter 2017/05/09 01:36:36 Done.
122 }.bind(this)); 123 }.bind(this));
123 }, 124 },
124 125
125 /** 126 /**
126 * Dispatch the INITIAL_SETTINGS_SET event. This call is NOT async and will 127 * Dispatch the INITIAL_SETTINGS_SET event. This call is NOT async and will
127 * happen in the same thread. 128 * happen in the same thread.
128 */ 129 */
129 setInitialSettings: function() { 130 setInitialSettings: function() {
130 var initialSettingsSetEvent = 131 var initialSettingsSetEvent =
131 new Event(print_preview.NativeLayer.EventType.INITIAL_SETTINGS_SET); 132 new Event(print_preview.NativeLayer.EventType.INITIAL_SETTINGS_SET);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 var scalingSettings = $('scaling-settings'); 620 var scalingSettings = $('scaling-settings');
620 621
621 // Check that options are collapsed (section is visible, because duplex is 622 // Check that options are collapsed (section is visible, because duplex is
622 // available). 623 // available).
623 checkSectionVisible(otherOptions, true); 624 checkSectionVisible(otherOptions, true);
624 checkElementDisplayed(fitToPage, false); 625 checkElementDisplayed(fitToPage, false);
625 if (isPrintAsImageEnabled()) 626 if (isPrintAsImageEnabled())
626 checkElementDisplayed(rasterize, false); 627 checkElementDisplayed(rasterize, false);
627 checkSectionVisible(mediaSize, false); 628 checkSectionVisible(mediaSize, false);
628 checkSectionVisible(scalingSettings, false); 629 checkSectionVisible(scalingSettings, false);
629
630 this.expandMoreSettings(); 630 this.expandMoreSettings();
631 631
632 checkElementDisplayed(fitToPage, false); 632 checkElementDisplayed(fitToPage, false);
633 if (isPrintAsImageEnabled()) 633 if (isPrintAsImageEnabled())
634 checkElementDisplayed(rasterize, false); 634 checkElementDisplayed(rasterize, false);
635 checkSectionVisible(mediaSize, true); 635 checkSectionVisible(mediaSize, true);
636 checkSectionVisible(scalingSettings, true); 636 checkSectionVisible(scalingSettings, true);
637
638 this.waitForAnimationToEnd('more-settings'); 637 this.waitForAnimationToEnd('more-settings');
639 }); 638 });
640 639
641 // When the source is "PDF", depending on the selected destination printer, we 640 // When the source is "PDF", depending on the selected destination printer, we
642 // show/hide the fit to page option and hide media size selection. 641 // show/hide the fit to page option and hide media size selection.
643 TEST_F('PrintPreviewWebUITest', 'SourceIsPDFCapabilities', function() { 642 TEST_F('PrintPreviewWebUITest', 'SourceIsPDFCapabilities', function() {
644 this.initialSettings_.isDocumentModifiable_ = false; 643 this.initialSettings_.isDocumentModifiable_ = false;
645 this.setInitialSettings(); 644 this.setInitialSettings();
646 this.setLocalDestinations(); 645 this.setLocalDestinations();
647 this.setCapabilities(getCddTemplate("FooDevice")); 646 this.setCapabilities(getCddTemplate("FooDevice"));
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 this.dispatchPreviewDone(); 1441 this.dispatchPreviewDone();
1443 1442
1444 // Has active print button and successfully "prints", indicating recovery 1443 // Has active print button and successfully "prints", indicating recovery
1445 // from error state. 1444 // from error state.
1446 expectFalse(printButton.disabled); 1445 expectFalse(printButton.disabled);
1447 expectFalse(this.hasPrinted()); 1446 expectFalse(this.hasPrinted());
1448 printButton.click(); 1447 printButton.click();
1449 expectTrue(this.hasPrinted()); 1448 expectTrue(this.hasPrinted());
1450 testDone(); 1449 testDone();
1451 }); 1450 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/settings/more_settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698