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

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

Issue 9699040: PrintPreview: Hide/Show the header footer option based on print frame margins. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 8 years, 9 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 | « chrome/renderer/print_web_view_helper_browsertest.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b427352a0539448084dbb7dcb28d69edc922281e..70a0f035c464e3c79e41ecd1ce1fc3732a2fb199 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -270,6 +270,51 @@ TEST_F('PrintPreviewWebUITest', 'TestSectionsDisabled', function() {
checkSectionVisible(copiesSettings.copiesOption_, false);
});
+// Page layout has zero margins. Hide header and footer option.
+TEST_F('PrintPreviewWebUITest', 'PageLayoutHasNoMarginsHideHeaderFooter',
+ function() {
+ setInitialSettings({previewModifiable: true});
+ onDidGetDefaultPageLayout({
+ contentWidth: 100, contentHeight: 200, marginLeft: 0, marginRight: 0,
+ marginTop: 0, marginBottom: 0, printableAreaX: 0, printableAreaY: 0,
+ printableAreaWidth: 100, printableAreaHeight: 200}, true);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, false);
+});
+
+// Page layout has non-zero margins. Show header and footer option.
+TEST_F('PrintPreviewWebUITest', 'PageLayoutHasMarginsShowHeaderFooter',
+ function() {
+ setInitialSettings({previewModifiable: true});
+ onDidGetDefaultPageLayout({
+ contentWidth: 100, contentHeight: 200, marginLeft: 3, marginRight: 2,
+ marginTop: 4, marginBottom: 1, printableAreaX: 1, printableAreaY: 1,
+ printableAreaWidth: 103, printableAreaHeight: 203}, true);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, true);
+});
+
+// Page layout has zero top and bottom margins. Hide header and footer option.
+TEST_F('PrintPreviewWebUITest', 'ZeroTopAndBottomMarginsHideHeaderFooter',
+ function() {
+ setInitialSettings({previewModifiable: true});
+ onDidGetDefaultPageLayout({
+ contentWidth: 100, contentHeight: 200, marginLeft: 3, marginRight: 2,
+ marginTop: 0, marginBottom: 0, printableAreaX: 1, printableAreaY: 1,
+ printableAreaWidth: 98, printableAreaHeight: 198}, false);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, false);
+});
+
+// Page layout has zero top and non-zero bottom margin. Show header and footer
+// option.
+TEST_F('PrintPreviewWebUITest', 'ZeroTopAndNonZeroBottomMarginShowHeaderFooter',
+ function() {
+ setInitialSettings({previewModifiable: true});
+ onDidGetDefaultPageLayout({
+ contentWidth: 100, contentHeight: 200, marginLeft: 6, marginRight: 4,
+ marginTop: 0, marginBottom: 3, printableAreaX: 1, printableAreaY: 1,
+ printableAreaWidth: 103, printableAreaHeight: 208}, false);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, true);
+});
+
// Test that the color settings are set according to the printer capabilities.
TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
this.mockHandler.expects(once()).getPrinterCapabilities('FooDevice').
« no previous file with comments | « chrome/renderer/print_web_view_helper_browsertest.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698