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..eda0551857d84ab9662c3e79c5724533cab9e7c1 100644 |
--- a/chrome/test/data/webui/print_preview.js |
+++ b/chrome/test/data/webui/print_preview.js |
@@ -270,6 +270,59 @@ TEST_F('PrintPreviewWebUITest', 'TestSectionsDisabled', function() { |
checkSectionVisible(copiesSettings.copiesOption_, false); |
}); |
+// Page layout has zero margins. Hide header and footer option. |
+TEST_F('PrintPreviewWebUITest', 'PageLayoutHasNoMarginsHideHeaderFooter', |
+ function() { |
+ onDidGetDefaultPageLayout({ |
+ contentWidth: 100, |
+ contentHeight: 200, |
+ marginLeft: 0, |
+ marginRight: 0, |
+ marginTop: 0, |
+ marginBottom: 0}, true, false); |
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, false); |
+}); |
+ |
+// Page layout has non-zero margins. Show header and footer option. |
+TEST_F('PrintPreviewWebUITest', 'PageLayoutHasMarginsShowHeaderFooter', |
+ function() { |
+ onDidGetDefaultPageLayout({ |
+ contentWidth: 100, |
+ contentHeight: 200, |
+ marginLeft: 3, |
+ marginRight: 2, |
+ marginTop: 4, |
+ marginBottom: 1}, true, true); |
+ checkSectionVisible(headerFooterSettings.headerFooterOption_, true); |
+}); |
+ |
+// Page layout has zero top and bottom margins. Hide header and footer option. |
+TEST_F('PrintPreviewWebUITest', 'ZeroTopAndBottomMarginsHideHeaderFooter', |
+ function() { |
+ onDidGetDefaultPageLayout({ |
+ contentWidth: 100, |
+ contentHeight: 200, |
+ marginLeft: 3, |
+ marginRight: 2, |
+ marginTop: 0, |
+ marginBottom: 0}, false, 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() { |
+ onDidGetDefaultPageLayout({ |
+ contentWidth: 100, |
+ contentHeight: 200, |
+ marginLeft: 6, |
+ marginRight: 4, |
+ marginTop: 0, |
+ marginBottom: 3}, false, true); |
+ 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'). |