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

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
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..a3061a588f64d02f6ac80af233ee05781857204a 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -270,6 +270,38 @@ TEST_F('PrintPreviewWebUITest', 'TestSectionsDisabled', function() {
checkSectionVisible(copiesSettings.copiesOption_, false);
});
+TEST_F('PrintPreviewWebUITest', 'HeaderFooterSectionDisabled', function() {
+ // Case 1: Zero margin values. Hide header footer option.
dpapad 2012/03/14 21:15:17 Maybe these cases should be broken to independent
kmadhusu 2012/03/14 22:10:14 sure. Done.
+ onDidGetDefaultPageLayout({
+ contentWidth: 100,
+ contentHeight: 200,
+ marginLeft: 0,
+ marginRight: 0,
+ marginTop: 0,
+ marginBottom: 0}, true, false);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, false);
+
+ // Case 2: Non-zero margins. Show header footer option.
+ onDidGetDefaultPageLayout({
+ contentWidth: 100,
+ contentHeight: 200,
+ marginLeft: 10,
+ marginRight: 10,
+ marginTop: 10,
+ marginBottom: 10}, true, true);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, true);
+
+ // Case 3: Zero top and bottom margins. Hide header footer option
+ onDidGetDefaultPageLayout({
+ contentWidth: 100,
+ contentHeight: 200,
+ marginLeft: 10,
+ marginRight: 10,
+ marginTop: 0,
+ marginBottom: 0}, false, false);
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, false);
+});
+
// Test that the color settings are set according to the printer capabilities.
TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
this.mockHandler.expects(once()).getPrinterCapabilities('FooDevice').

Powered by Google App Engine
This is Rietveld 408576698