| 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 dacefd0563fc1d7a626a87ba508f3b66d34069dd..e4827f114e4915ca87f03ca16b48394caf519d19 100644
|
| --- a/chrome/test/data/webui/print_preview.js
|
| +++ b/chrome/test/data/webui/print_preview.js
|
| @@ -68,6 +68,7 @@ PrintPreviewWebUITest.prototype = {
|
| disableColorOption: true,
|
| setColorAsDefault: true,
|
| disableCopiesOption: true,
|
| + printerDefaultDuplexValue: copiesSettings.UNKNOWN,
|
| });
|
| }));
|
| var savedArgs = new SaveMockArguments();
|
| @@ -298,6 +299,7 @@ TEST_F('PrintPreviewWebUITest', 'TestSectionsDisabled', function() {
|
| setColorAsDefault: true,
|
| disableCopiesOption: true,
|
| disableLandscapeOption: true,
|
| + printerDefaultDuplexValue: copiesSettings.SIMPLEX,
|
| });
|
| }));
|
|
|
| @@ -317,6 +319,7 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
|
| setColorAsDefault: true,
|
| disableCopiesOption: false,
|
| disableLandscapeOption: false,
|
| + printerDefaultDuplexValue: copiesSettings.SIMPLEX,
|
| });
|
| }));
|
|
|
| @@ -331,6 +334,7 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
|
| setColorAsDefault: false,
|
| disableCopiesOption: false,
|
| disableLandscapeOption: false,
|
| + printerDefaultDuplexValue: copiesSettings.SIMPLEX,
|
| });
|
| }));
|
|
|
| @@ -339,6 +343,41 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
|
| expectTrue(colorSettings.bwRadioButton.checked);
|
| });
|
|
|
| +// Test to verify that duplex settings are set according to the printer
|
| +// capabilities.
|
| +TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() {
|
| + this.mockHandler.expects(once()).getPrinterCapabilities('FooDevice').
|
| + will(callFunction(function() {
|
| + updateWithPrinterCapabilities({
|
| + disableColorOption: false,
|
| + setColorAsDefault: false,
|
| + disableCopiesOption: false,
|
| + disableLandscapeOption: false,
|
| + printerDefaultDuplexValue: copiesSettings.SIMPLEX,
|
| + });
|
| + }));
|
| + updateControlsWithSelectedPrinterCapabilities();
|
| + expectEquals(copiesSettings.duplexMode, copiesSettings.SIMPLEX);
|
| +
|
| + // If the printer default duplex value is UNKNOWN and the user has selected
|
| + // duplex printing, we set print job duplex setting as DUPLEX.
|
| + this.mockHandler.expects(once()).getPrinterCapabilities('FooDevice').
|
| + will(callFunction(function() {
|
| + updateWithPrinterCapabilities({
|
| + disableColorOption: false,
|
| + setColorAsDefault: false,
|
| + disableCopiesOption: false,
|
| + disableLandscapeOption: false,
|
| + printerDefaultDuplexValue: copiesSettings.UNKNOWN,
|
| + });
|
| + }));
|
| + updateControlsWithSelectedPrinterCapabilities();
|
| + expectEquals(copiesSettings.duplexMode, copiesSettings.SIMPLEX);
|
| + copiesSettings.twoSidedCheckbox.checked = true;
|
| + expectEquals(copiesSettings.duplexMode, copiesSettings.DUPLEX);
|
| +
|
| +});
|
| +
|
| // Test that changing the selected printer updates the preview.
|
| TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
|
| var savedArgs = new SaveMockArguments();
|
|
|