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

Unified Diff: third_party/WebKit/LayoutTests/printing/page-height-zero.html

Issue 1552703003: Internals: throw an exception when page height or width is 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use js-test.js , which provides shouldThrow() Created 4 years, 12 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 | third_party/WebKit/LayoutTests/printing/page-height-zero-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/printing/page-height-zero.html
diff --git a/third_party/WebKit/LayoutTests/printing/page-height-zero.html b/third_party/WebKit/LayoutTests/printing/page-height-zero.html
new file mode 100644
index 0000000000000000000000000000000000000000..8ac0f39591058fbab5c0a0173dcb38eee8dc55b1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/printing/page-height-zero.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+<style>
+ @media print {
+ /* Need something to trigger multicol layout when entering print mode,
+ to trigger the original crash bug (division by zero). */
+ #multicol { width: 50%; }
+ }
+</style>
+<div id="multicol" style="-webkit-columns:2;">&nbsp;</div>
+<script>
+ description("Test that an exception is thrown when attempting to set zero page height");
+ if (window.internals) {
+ shouldThrow("internals.numberOfPages(100, 0)");
+ shouldThrow("internals.pageNumber(document.body, 100, 0)");
+ } else {
+ testFailed("This test requires window.internals");
+ }
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/printing/page-height-zero-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698