Chromium Code Reviews| 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..0c33a2b6c803362ac33745dd834eaa32e1a41bd4 100644 |
| --- a/chrome/test/data/webui/print_preview.js |
| +++ b/chrome/test/data/webui/print_preview.js |
| @@ -474,8 +474,11 @@ 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 printPresetOptions = {disableScaling: true}; |
| + var printPresetOptionsEvent = new Event( |
| + print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS); |
| + printPresetOptionsEvent.optionsFromDocument = printPresetOptions; |
|
Aleksey Shlyapnikov
2014/12/04 18:45:57
Since you're not reusing them, inline them here:
Nikhil
2014/12/09 11:00:35
Done.
|
| + this.nativeLayer_.dispatchEvent(printPresetOptionsEvent); |
| var otherOptions = $('other-options-settings'); |
| checkSectionVisible(otherOptions, true); |
| @@ -487,6 +490,29 @@ 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}; |
|
Aleksey Shlyapnikov
2014/12/04 18:45:57
var printPresetOptions = {
disableScaling: true,
Nikhil
2014/12/09 11:00:35
Done.
|
| + 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(); |