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 3a51956c780355b014d265537e7fdcaf0dc2a9b7..ad4cb25b92a1139a7b0c62d875d9f9f5a139df76 100644 |
| --- a/chrome/test/data/webui/print_preview.js |
| +++ b/chrome/test/data/webui/print_preview.js |
| @@ -243,12 +243,33 @@ TEST_F('PrintPreviewWebUITest', 'TestSectionsDisabled', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': true, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': false, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"} |
| + ] |
| + }, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -322,12 +343,35 @@ TEST_F('PrintPreviewWebUITest', 'SourceIsHTMLHideFitToPageOption', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -354,12 +398,35 @@ TEST_F('PrintPreviewWebUITest', 'SourceIsPDFShowFitToPageOption', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -389,12 +456,35 @@ TEST_F('PrintPreviewWebUITest', 'PrintScalingDisabledForPlugin', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -427,12 +517,35 @@ TEST_F('PrintPreviewWebUITest', |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -467,12 +580,35 @@ TEST_F('PrintPreviewWebUITest', |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -507,12 +643,35 @@ TEST_F('PrintPreviewWebUITest', |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -548,12 +707,35 @@ TEST_F('PrintPreviewWebUITest', |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -586,12 +768,35 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettingsTrue', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': false, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -618,12 +823,34 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettingsFalse', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': true, |
| - 'setColorAsDefault': false, |
| - 'disableCopiesOption': false, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -655,13 +882,35 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettingsTrue', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': false, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0, |
| - 'setDuplexAsDefault': false |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -689,13 +938,28 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettingsFalse', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': false, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': -1, |
| - 'setDuplexAsDefault': false |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -719,12 +983,35 @@ TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'FooDevice', |
| - 'disableColorOption': false, |
| - 'setColorAsDefault': true, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "FooDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_COLOR"}, |
| + {"type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
|
Vitaly Buka (NO REVIEWS)
2014/06/04 00:05:46
duplicates?
Aleksey Shlyapnikov
2014/06/04 02:02:47
Done.
|
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| @@ -746,12 +1033,34 @@ TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() { |
| var capsSetEvent = |
| new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); |
| capsSetEvent.settingsInfo = { |
| - 'printerId': 'BarDevice', |
| - 'disableColorOption': true, |
| - 'setColorAsDefault': false, |
| - 'disableCopiesOption': true, |
| - 'disableLandscapeOption': true, |
| - 'printerDefaultDuplexValue': 0 |
| + "printerId": "BarDevice", |
| + "capabilities": { |
| + "version": "1.0", |
| + "printer": { |
| + "supported_content_type": [{"content_type": "application/pdf"}], |
| + "collate": {}, |
| + "color": { |
| + "option": [ |
| + {"is_default": true, "type": "STANDARD_MONOCHROME"} |
| + ] |
| + }, |
| + "copies": {}, |
| + "duplex": { |
| + "option": [ |
| + {"is_default": true, "type": "NO_DUPLEX"}, |
| + {"type": "LONG_EDGE"}, |
| + {"type": "SHORT_EDGE"} |
| + ] |
| + }, |
| + "page_orientation": { |
| + "option": [ |
| + {"is_default": true, "type": "PORTRAIT"}, |
| + {"type": "LANDSCAPE"}, |
| + {"type": "AUTO"} |
| + ] |
| + } |
| + } |
| + } |
| }; |
| this.nativeLayer_.dispatchEvent(capsSetEvent); |
| }); |