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

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

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Remove unnecessary struct and variable Created 4 years 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
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 ce7817d0003b6671be1712a38ef4a898f39dbd3a..634d994dcaca6d222426ffbf1b2dbf13ae175db0 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -518,7 +518,12 @@ TEST_F('PrintPreviewWebUITest', 'PrintToPDFSelectedCapabilities', function() {
};
this.setCapabilities(device);
- checkSectionVisible($('other-options-settings'), false);
+ var otherOptions = $('other-options-settings');
+ checkSectionVisible(otherOptions, true);
+ checkElementDisplayed(
+ otherOptions.querySelector('.fit-to-page-container'), false);
+ checkElementDisplayed(
+ otherOptions.querySelector('.rasterize-container'), true);
checkSectionVisible($('media-size-settings'), false);
checkSectionVisible($('scaling-settings'), false);
@@ -534,6 +539,7 @@ TEST_F('PrintPreviewWebUITest', 'SourceIsHTMLCapabilities', function() {
var otherOptions = $('other-options-settings');
var fitToPage = otherOptions.querySelector('.fit-to-page-container');
+ var rasterize = otherOptions.querySelector('.rasterize-container');
var mediaSize = $('media-size-settings');
var scalingSettings = $('scaling-settings');
@@ -541,12 +547,14 @@ TEST_F('PrintPreviewWebUITest', 'SourceIsHTMLCapabilities', function() {
// available).
checkSectionVisible(otherOptions, true);
checkElementDisplayed(fitToPage, false);
+ checkElementDisplayed(rasterize, false);
checkSectionVisible(mediaSize, false);
checkSectionVisible(scalingSettings, false);
this.expandMoreSettings();
checkElementDisplayed(fitToPage, false);
+ checkElementDisplayed(rasterize, false);
checkSectionVisible(mediaSize, true);
checkSectionVisible(scalingSettings, true);
@@ -563,13 +571,20 @@ TEST_F('PrintPreviewWebUITest', 'SourceIsPDFCapabilities', function() {
var otherOptions = $('other-options-settings');
var scalingSettings = $('scaling-settings');
+ var fitToPageContainer =
+ otherOptions.querySelector('.fit-to-page-container');
+ var rasterizeContainer =
+ otherOptions.querySelector('.rasterize-container');
checkSectionVisible(otherOptions, true);
- checkElementDisplayed(
- otherOptions.querySelector('.fit-to-page-container'), true);
+ checkElementDisplayed(fitToPageContainer, true);
+ checkElementDisplayed(rasterizeContainer, false);
expectTrue(
- otherOptions.querySelector('.fit-to-page-checkbox').checked);
+ fitToPageContainer.querySelector('.checkbox').checked);
this.expandMoreSettings();
+ checkElementDisplayed(rasterizeContainer, true);
+ expectFalse(
+ rasterizeContainer.querySelector('.checkbox').checked);
checkSectionVisible($('media-size-settings'), true);
checkSectionVisible(scalingSettings, true);
@@ -588,10 +603,11 @@ TEST_F('PrintPreviewWebUITest', 'ScalingUnchecksFitToPage', function() {
var scalingSettings = $('scaling-settings');
checkSectionVisible(otherOptions, true);
- checkElementDisplayed(
- otherOptions.querySelector('.fit-to-page-container'), true);
+ var fitToPageContainer =
+ otherOptions.querySelector('.fit-to-page-container');
+ checkElementDisplayed(fitToPageContainer, true);
expectTrue(
- otherOptions.querySelector('.fit-to-page-checkbox').checked);
+ fitToPageContainer.querySelector('.checkbox').checked);
this.expandMoreSettings();
checkSectionVisible($('media-size-settings'), true);
checkSectionVisible(scalingSettings, true);
@@ -608,7 +624,7 @@ TEST_F('PrintPreviewWebUITest', 'ScalingUnchecksFitToPage', function() {
enter.keyCode = 'Enter';
scalingInput.dispatchEvent(enter);
expectFalse(
- otherOptions.querySelector('.fit-to-page-checkbox').checked);
+ fitToPageContainer.querySelector('.checkbox').checked);
this.waitForAnimationToEnd('other-options-collapsible');
});
@@ -658,8 +674,9 @@ TEST_F('PrintPreviewWebUITest', 'CheckDuplexPrintPreset', function() {
var otherOptions = $('other-options-settings');
checkSectionVisible(otherOptions, true);
- checkElementDisplayed(otherOptions.querySelector('.duplex-container'), true);
- expectTrue(otherOptions.querySelector('.duplex-checkbox').checked);
+ var duplexContainer = otherOptions.querySelector('.duplex-container');
+ checkElementDisplayed(duplexContainer, true);
+ expectTrue(duplexContainer.querySelector('.checkbox').checked);
this.waitForAnimationToEnd('other-options-collapsible');
});
@@ -955,8 +972,9 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettingsTrue', function() {
var otherOptions = $('other-options-settings');
checkSectionVisible(otherOptions, true);
- expectFalse(otherOptions.querySelector('.duplex-container').hidden);
- expectFalse(otherOptions.querySelector('.duplex-checkbox').checked);
+ duplexContainer = otherOptions.querySelector('.duplex-container');
+ expectFalse(duplexContainer.hidden);
+ expectFalse(duplexContainer.querySelector('.checkbox').checked);
this.waitForAnimationToEnd('more-settings');
});
@@ -992,8 +1010,8 @@ TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
var previewGenerator = mock(print_preview.PreviewGenerator);
printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy();
- // TODO (rbpotter): Figure out why this is 7 with the addition of scaling,
- // and if it is a problem.
+ // The number of settings that can change due to a change in the destination
+ // that will therefore dispatch ticket item change events.
previewGenerator.expects(exactly(7)).requestPreview();
var barDestination;

Powered by Google App Engine
This is Rietveld 408576698