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

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

Issue 974183003: Print Preview: Support the duplex preset in PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
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 76d3aa875756bf6367340c25e3f3eca4a8e31f77..720ecd430baa56ec7bde6d349714c6f7f6af172a 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -500,7 +500,7 @@ TEST_F('PrintPreviewWebUITest', 'PrintScalingDisabledForPlugin', function() {
});
// When the number of copies print preset is set for source 'PDF', we update
-// copies value if capability is supported by printer.
+// the copies value if capability is supported by printer.
TEST_F('PrintPreviewWebUITest', 'CheckNumCopiesPrintPreset', function() {
this.initialSettings_.isDocumentModifiable_ = false;
this.setInitialSettings();
@@ -525,6 +525,31 @@ TEST_F('PrintPreviewWebUITest', 'CheckNumCopiesPrintPreset', function() {
this.waitForAnimationToEnd('other-options-collapsible');
});
+// When the duplex print preset is set for source 'PDF', we update the
+// duplex setting if capability is supported by printer.
+TEST_F('PrintPreviewWebUITest', 'CheckDuplexPrintPreset', function() {
+ this.initialSettings_.isDocumentModifiable_ = false;
+ this.setInitialSettings();
+ this.setLocalDestinations();
+ this.setCapabilities(getCddTemplate("FooDevice"));
+
+ // Indicate that the duplex print preset is set to "long edge" for source PDF.
+ var printPresetOptions = {
+ duplex: 1
+ };
+ var printPresetOptionsEvent = new Event(
+ print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS);
+ printPresetOptionsEvent.optionsFromDocument = printPresetOptions;
+ this.nativeLayer_.dispatchEvent(printPresetOptionsEvent);
+
+ var otherOptions = $('other-options-settings');
+ checkSectionVisible(otherOptions, true);
+ checkElementDisplayed(otherOptions.querySelector('.duplex-container'), true);
+ expectTrue(otherOptions.querySelector('.duplex-checkbox').checked);
+
+ 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') | components/printing/renderer/print_web_view_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698