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(); |