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

Unified Diff: chrome/test/data/webui/print_preview.js

Issue 407733002: [JS Changes] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback (nit fixes for test case) Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/print_preview.js
diff --git a/chrome/test/data/webui/print_preview.js b/chrome/test/data/webui/print_preview.js
index ad4993642aa75096850d916bc158a57b0ccae795..96199aa4ddc757a0848295400b88d3542b8bb138 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -474,8 +474,10 @@ TEST_F('PrintPreviewWebUITest', 'PrintScalingDisabledForPlugin', function() {
this.setCapabilities(getCddTemplate("FooDevice"));
// Indicate that the PDF does not support scaling by default.
- cr.dispatchSimpleEvent(
- this.nativeLayer_, print_preview.NativeLayer.EventType.DISABLE_SCALING);
+ var printPresetOptionsEvent = new Event(
+ print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS);
+ printPresetOptionsEvent.optionsFromDocument = {disableScaling: true};
+ this.nativeLayer_.dispatchEvent(printPresetOptionsEvent);
var otherOptions = $('other-options-settings');
checkSectionVisible(otherOptions, true);
@@ -487,6 +489,32 @@ TEST_F('PrintPreviewWebUITest', 'PrintScalingDisabledForPlugin', function() {
this.waitForAnimationToEnd('other-options-collapsible');
});
+// When the number of copies print preset is set for source 'PDF', we update
+// copies value if capability is supported by printer.
+TEST_F('PrintPreviewWebUITest', 'CheckNumCopiesPrintPreset', function() {
+ this.initialSettings_.isDocumentModifiable_ = false;
+ this.setInitialSettings();
+ this.setLocalDestinations();
+ this.setCapabilities(getCddTemplate("FooDevice"));
+
+ // Indicate that the number of copies print preset is set for source PDF.
+ var printPresetOptions = {
+ disableScaling: true,
+ copies: 2
+ };
+ var printPresetOptionsEvent = new Event(
+ print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS);
+ printPresetOptionsEvent.optionsFromDocument = printPresetOptions;
+ this.nativeLayer_.dispatchEvent(printPresetOptionsEvent);
+
+ checkSectionVisible($('copies-settings'), true);
+ expectEquals(
+ printPresetOptions.copies,
+ parseInt($('copies-settings').querySelector('.copies').value));
+
+ this.waitForAnimationToEnd('other-options-collapsible');
+});
+
// Make sure that custom margins controls are properly set up.
TEST_F('PrintPreviewWebUITest', 'CustomMarginsControlsCheck', function() {
this.setInitialSettings();
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698