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

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

Issue 2911203003: Print Preview: Migrate JS tests to use Mocha, part 3. (Closed)
Patch Set: Cleanup Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview/print_preview_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/print_preview/print_preview.js
diff --git a/chrome/test/data/webui/print_preview/print_preview.js b/chrome/test/data/webui/print_preview/print_preview.js
index fbc893c79c1c5f034ebc1e9df5c210ded2586f6c..8c167375d7b37a829105100754c40358a19ff79d 100644
--- a/chrome/test/data/webui/print_preview/print_preview.js
+++ b/chrome/test/data/webui/print_preview/print_preview.js
@@ -295,288 +295,6 @@ function isPrintAsImageEnabled() {
loadTimeData.getBoolean('printPdfAsImageEnabled'));
}
-
-// Page layout has zero top and bottom margins. Hide header and footer option.
-TEST_F('PrintPreviewWebUITest',
- 'ZeroTopAndBottomMarginsHideHeaderFooter',
- function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
- this.setCapabilities(getCddTemplate("FooDevice"));
-
- var otherOptions = $('other-options-settings');
- var headerFooter =
- otherOptions.querySelector('#header-footer-container');
-
- // Check that options are collapsed (section is visible, because duplex
- // is available).
- checkSectionVisible(otherOptions, true);
- checkElementDisplayed(headerFooter, false);
-
- this.expandMoreSettings();
-
- checkElementDisplayed(headerFooter, true);
-
- this.printPreview_.printTicketStore_.marginsType.updateValue(
- print_preview.ticket_items.MarginsTypeValue.CUSTOM);
- this.printPreview_.printTicketStore_.customMargins.updateValue(
- new print_preview.Margins(0, 36, 0, 36));
-
- checkElementDisplayed(headerFooter, false);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Page layout has zero top and half-inch bottom margin. Show header and footer
-// option.
-TEST_F('PrintPreviewWebUITest',
- 'ZeroTopAndNonZeroBottomMarginShowHeaderFooter',
- function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
- this.setCapabilities(getCddTemplate("FooDevice"));
-
- var otherOptions = $('other-options-settings');
- var headerFooter =
- otherOptions.querySelector('#header-footer-container');
-
- // Check that options are collapsed (section is visible, because duplex
- // is available).
- checkSectionVisible(otherOptions, true);
- checkElementDisplayed(headerFooter, false);
-
- this.expandMoreSettings();
-
- checkElementDisplayed(headerFooter, true);
-
- this.printPreview_.printTicketStore_.marginsType.updateValue(
- print_preview.ticket_items.MarginsTypeValue.CUSTOM);
- this.printPreview_.printTicketStore_.customMargins.updateValue(
- new print_preview.Margins(0, 36, 36, 36));
-
- checkElementDisplayed(headerFooter, true);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Check header footer availability with small (label) page size.
-TEST_F('PrintPreviewWebUITest', 'SmallPaperSizeHeaderFooter', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.media_size = {
- "option": [
- {"name": "SmallLabel", "width_microns": 38100,
- "height_microns": 12700, "is_default": false},
- {"name": "BigLabel", "width_microns": 50800,
- "height_microns": 76200, "is_default": true}
- ]
- };
- this.setCapabilities(device);
-
- var otherOptions = $('other-options-settings');
- var headerFooter =
- otherOptions.querySelector('#header-footer-container');
-
- // Check that options are collapsed (section is visible, because duplex
- // is available).
- checkSectionVisible(otherOptions, true);
- checkElementDisplayed(headerFooter, false);
-
- this.expandMoreSettings();
-
- // Big label should have header/footer
- checkElementDisplayed(headerFooter, true);
-
- // Small label should not
- this.printPreview_.printTicketStore_.mediaSize.updateValue(
- device.capabilities.printer.media_size.option[0]);
- checkElementDisplayed(headerFooter, false);
-
- // Oriented in landscape, there should be enough space for
- // header/footer.
- this.printPreview_.printTicketStore_.landscape.updateValue(true);
- checkElementDisplayed(headerFooter, true);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, one option, standard monochrome.
-TEST_F('PrintPreviewWebUITest', 'TestColorSettingsMonochrome', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- // Only one option, standard monochrome.
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"is_default": true, "type": "STANDARD_MONOCHROME"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), false);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, one option, custom monochrome.
-TEST_F('PrintPreviewWebUITest', 'TestColorSettingsCustomMonochrome',
- function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- // Only one option, standard monochrome.
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"is_default": true, "type": "CUSTOM_MONOCHROME",
- "vendor_id": "42"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), false);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, one option, standard color.
-TEST_F('PrintPreviewWebUITest', 'TestColorSettingsColor', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"is_default": true, "type": "STANDARD_COLOR"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), false);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, one option, custom color.
-TEST_F('PrintPreviewWebUITest', 'TestColorSettingsCustomColor', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"is_default": true, "type": "CUSTOM_COLOR", "vendor_id": "42"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), false);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, two options, both standard, defaults to color.
-TEST_F('PrintPreviewWebUITest', 'TestColorSettingsBothStandardDefaultColor',
- function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"type": "STANDARD_MONOCHROME"},
- {"is_default": true, "type": "STANDARD_COLOR"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), true);
- expectEquals(
- 'color',
- $('color-settings').querySelector('.color-settings-select').value);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, two options, both standard, defaults to
-// monochrome.
-TEST_F('PrintPreviewWebUITest',
- 'TestColorSettingsBothStandardDefaultMonochrome', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"is_default": true, "type": "STANDARD_MONOCHROME"},
- {"type": "STANDARD_COLOR"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), true);
- expectEquals(
- 'bw',
- $('color-settings').querySelector('.color-settings-select').value);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
-// Test that the color settings, two options, both custom, defaults to color.
-TEST_F('PrintPreviewWebUITest',
- 'TestColorSettingsBothCustomDefaultColor', function() {
- this.setInitialSettings();
- this.nativeLayer_.whenCalled('getInitialSettings').then(
- function() {
- this.setLocalDestinations();
-
- var device = getCddTemplate("FooDevice");
- device.capabilities.printer.color = {
- "option": [
- {"type": "CUSTOM_MONOCHROME", "vendor_id": "42"},
- {"is_default": true, "type": "CUSTOM_COLOR", "vendor_id": "43"}
- ]
- };
- this.setCapabilities(device);
-
- checkSectionVisible($('color-settings'), true);
- expectEquals(
- 'color',
- $('color-settings').querySelector('.color-settings-select').value);
-
- this.waitForAnimationToEnd('more-settings');
- }.bind(this));
-});
-
// Test to verify that duplex settings are set according to the printer
// capabilities.
TEST_F('PrintPreviewWebUITest', 'TestDuplexSettingsTrue', function() {
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview/print_preview_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698