2010-02-09 Shinichiro Hamaji <hamaji@chromium.org>
authorhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2010 09:39:16 +0000 (09:39 +0000)
committerhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2010 09:39:16 +0000 (09:39 +0000)
        Reviewed by Darin Adler.

        Add modified version of CSS2.1 test suite for paged media
        https://bugs.webkit.org/show_bug.cgi?id=34695

        Note that page-break-inside-000 is failing now.

        * platform/qt/Skipped:
        * platform/win/Skipped:
        * printing/css2.1/README.txt: Added.
        * printing/css2.1/page-break-after-000-expected.txt: Added.
        * printing/css2.1/page-break-after-000.html: Added.
        * printing/css2.1/page-break-after-001-expected.txt: Added.
        * printing/css2.1/page-break-after-001.html: Added.
        * printing/css2.1/page-break-after-002-expected.txt: Added.
        * printing/css2.1/page-break-after-002.html: Added.
        * printing/css2.1/page-break-after-004-expected.txt: Added.
        * printing/css2.1/page-break-after-004.html: Added.
        * printing/css2.1/page-break-before-000-expected.txt: Added.
        * printing/css2.1/page-break-before-000.html: Added.
        * printing/css2.1/page-break-before-001-expected.txt: Added.
        * printing/css2.1/page-break-before-001.html: Added.
        * printing/css2.1/page-break-before-002-expected.txt: Added.
        * printing/css2.1/page-break-before-002.html: Added.
        * printing/css2.1/page-break-inside-000-expected.txt: Added.
        * printing/css2.1/page-break-inside-000.html: Added.
        * printing/resources/paged-media-test-utils.js: Added.
        (pageNumberShouldBe):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54538 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/printing/css2.1/README.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-000-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-000.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-001-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-001.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-002-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-002.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-004-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-after-004.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-000-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-000.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-001-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-001.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-002-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-before-002.html [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-inside-000-expected.txt [new file with mode: 0644]
LayoutTests/printing/css2.1/page-break-inside-000.html [new file with mode: 0644]
LayoutTests/printing/resources/paged-media-test-utils.js [new file with mode: 0644]

index 37afc2f..272317c 100644 (file)
@@ -1,3 +1,34 @@
+2010-02-09  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add modified version of CSS2.1 test suite for paged media
+        https://bugs.webkit.org/show_bug.cgi?id=34695
+
+        Note that page-break-inside-000 is failing now.
+
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+        * printing/css2.1/README.txt: Added.
+        * printing/css2.1/page-break-after-000-expected.txt: Added.
+        * printing/css2.1/page-break-after-000.html: Added.
+        * printing/css2.1/page-break-after-001-expected.txt: Added.
+        * printing/css2.1/page-break-after-001.html: Added.
+        * printing/css2.1/page-break-after-002-expected.txt: Added.
+        * printing/css2.1/page-break-after-002.html: Added.
+        * printing/css2.1/page-break-after-004-expected.txt: Added.
+        * printing/css2.1/page-break-after-004.html: Added.
+        * printing/css2.1/page-break-before-000-expected.txt: Added.
+        * printing/css2.1/page-break-before-000.html: Added.
+        * printing/css2.1/page-break-before-001-expected.txt: Added.
+        * printing/css2.1/page-break-before-001.html: Added.
+        * printing/css2.1/page-break-before-002-expected.txt: Added.
+        * printing/css2.1/page-break-before-002.html: Added.
+        * printing/css2.1/page-break-inside-000-expected.txt: Added.
+        * printing/css2.1/page-break-inside-000.html: Added.
+        * printing/resources/paged-media-test-utils.js: Added.
+        (pageNumberShouldBe):
+
 2010-02-07  Yuzo Fujishima  <yuzo@google.com>
 
         Reviewed by Dan Bernstein.
index 83c3cc7..e6206ce 100644 (file)
@@ -5074,6 +5074,7 @@ fast/loader/crash-copying-backforwardlist.html
 # Implement LayoutTestController::pageNumberForElementById().
 printing/page-break-always.html
 printing/pageNumerForElementById.html
+printing/css2.1
 
 # Because ENABLE_DASHBOARD_SUPPORT=0 is the default option. (Apple's dashboard support in OS X)
 fast/css/dashboard-regions-attr-crash.html
index da8f3de..e1d1cb9 100644 (file)
@@ -740,6 +740,7 @@ http/tests/media/video-referer.html
 # Implement LayoutTestController::pageNumberForElementById().
 printing/page-break-always.html
 printing/pageNumerForElementById.html
+printing/css2.1
 
 # http/tests/security/xss-DENIED-window-open-javascript-url.html timed out on Windows Debug Bot
 # https://bugs.webkit.org/show_bug.cgi?id=33349
diff --git a/LayoutTests/printing/css2.1/README.txt b/LayoutTests/printing/css2.1/README.txt
new file mode 100644 (file)
index 0000000..bf153d9
--- /dev/null
@@ -0,0 +1,21 @@
+This is the modified version of W3C's CSS2.1 test suite.
+
+http://www.w3.org/Style/CSS/Test/CSS2.1/20100127/html4/chapter-13.htm
+
+We maintain the hand-modified version because adding unmodified printing
+related tests into LayoutTests/css2.1 directory doesn't make sense at all.
+
+We need the following modifications to add W3C's test into this directory:
+
+- Eliminate tabs.
+- Add dumpAsText() call.
+- Add test() function and implement it using layoutTestController functions.
+- Add id attributes for elements in question.
+- Add <div id="results"> to report the test results.
+
+FIXME: We have no way to get the number of last page for now.
+       Though page-break-before-003 is actually failing, we cannot add
+       failing test due to the lack of this feature.
+
+FIXME: page-margin-* aren't added yet. We may need
+       layoutTestController APIs to test margins.
diff --git a/LayoutTests/printing/css2.1/page-break-after-000-expected.txt b/LayoutTests/printing/css2.1/page-break-after-000-expected.txt
new file mode 100644 (file)
index 0000000..e1b3d85
--- /dev/null
@@ -0,0 +1,4 @@
+There must be a page break after this paragraph, followed by another line of content. This test should produce two pages of output.
+This text should be at the top of the second and final page.
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-after-000.html b/LayoutTests/printing/css2.1/page-break-after-000.html
new file mode 100644 (file)
index 0000000..1919b62
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-after: always</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<meta content="paged" name="flags">
+<meta content="The 'always' value of the 'page-break-after' property forces a page break after the box." name="assert">
+<style type="text/css">
+
+    div.break {
+        page-break-after:always;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test', 1);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div class="break">There must be a page break after this paragraph, followed by another line of content. This test should produce two pages of output.</div>
+    <div id="test">
+        This text should be at the top of the second and final page.
+    </div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-after-001-expected.txt b/LayoutTests/printing/css2.1/page-break-after-001-expected.txt
new file mode 100644 (file)
index 0000000..7f3a6e3
--- /dev/null
@@ -0,0 +1,4 @@
+There must not be a page break after this line of text.
+This test should produce only one page of output.
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-after-001.html b/LayoutTests/printing/css2.1/page-break-after-001.html
new file mode 100644 (file)
index 0000000..daff7d9
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-after: auto</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<meta content="paged" name="flags">
+<meta content="The 'always' value of the 'page-break-after' property forces a page break after the box." name="assert">
+<style type="text/css">
+    div.noBreak {
+        page-break-after:always;
+        page-break-after:auto;
+    }
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test', 0);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div class="noBreak">There must <strong>not</strong> be a page break after this line of text.</div>
+    <div id="test">This test should produce only one page of output.</div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-after-002-expected.txt b/LayoutTests/printing/css2.1/page-break-after-002-expected.txt
new file mode 100644 (file)
index 0000000..5b1222e
--- /dev/null
@@ -0,0 +1,8 @@
+This sentence must be on the first page.
+
+This sentence must be on the second page.
+This sentence must be either on the second or on the third page.
+
+PASS
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-after-002.html b/LayoutTests/printing/css2.1/page-break-after-002.html
new file mode 100644 (file)
index 0000000..1a7fcac
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-after applies to blocks</title>
+<link rel="author" href="mailto:tclancy@revenution.com" title="Tom Clancy">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<link rel="help" href="http://www.w3.org/TR/css3-page/#pg-br-before-after">
+<meta content="paged" name="flags">
+<meta content="The 'page-break-after' property must be applied to block-level elements and may be applied to other elements." name="assert">
+<style type="text/css">
+    p {page-break-after: always;}
+    p.noBreak {
+        display: inline;
+    }
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test1', 1);
+        // As of February 2010, CSS spec says user agents may apply
+        // page-break-* to inline boxes. Though we are using 1 as the
+        // expected page number, 2 should be also OK.
+        pageNumberShouldBe('test2', 1);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <p>This sentence must be on the first page.</p>
+        <p class="noBreak" id="test1">This sentence must be on the second page.</p>
+    <p id="test2">This sentence must be either on the second or on the third page.</p>
+    <div id="results"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-after-004-expected.txt b/LayoutTests/printing/css2.1/page-break-after-004-expected.txt
new file mode 100644 (file)
index 0000000..cfad409
--- /dev/null
@@ -0,0 +1,8 @@
+This test must produce two pages of output. This sentence must be on the first page.
+This sentence must be at the top of the second page.
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+This must be the last sentence on the second and final page.
+
+PASS
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-after-004.html b/LayoutTests/printing/css2.1/page-break-after-004.html
new file mode 100644 (file)
index 0000000..8010d00
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-after (invalid syntax)</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<meta content="paged invalid" name="flags">
+<meta content="The syntax of the 'page-break-after' property is auto | always | avoid | left | right." name="assert">
+<style type="text/css">
+
+    div.noBreakAuto {
+        page-break-after:always;
+        page-break-after:auto auto;
+    }
+    div.noBreakLeft {
+        page-break-after:auto;
+        page-break-after:left always;
+    }
+    div.noBreakAlways {
+        page-break-after:always always;
+    }
+    .dummy {
+        color:gray;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test1', 1);
+        pageNumberShouldBe('test2', 1);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div class="noBreakAuto">This test must produce two pages of output. This sentence must be on the first page.</div>
+    <div class="noBreakLeft" id="test1">This sentence must be at the top of the second page.</div>
+    <div class="noBreakAlways dummy">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
+    <p id="test2">This must be the last sentence on the second and final page.</p>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-before-000-expected.txt b/LayoutTests/printing/css2.1/page-break-before-000-expected.txt
new file mode 100644 (file)
index 0000000..05f066a
--- /dev/null
@@ -0,0 +1,4 @@
+This test should produce two pages of output. This text should be at the top of the first page.
+This text should be at the top of the second and final page.
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-before-000.html b/LayoutTests/printing/css2.1/page-break-before-000.html
new file mode 100644 (file)
index 0000000..ae35ded
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-before: always</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<link rel="help" href="http://www.w3.org/TR/css3-page/#pg-br-before-after">
+<meta content="paged" name="flags">
+<meta content="The 'always' value of the 'page-break-before' property forces a page break before the box." name="assert">
+<style type="text/css">
+
+    div.break {
+        page-break-before:always;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test', 1);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div>This test should produce two pages of output. This text should be at the top of the first page.</div>
+    <div class="break" id="test">This text should be at the top of the second and final page.</div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-before-001-expected.txt b/LayoutTests/printing/css2.1/page-break-before-001-expected.txt
new file mode 100644 (file)
index 0000000..7f3a6e3
--- /dev/null
@@ -0,0 +1,4 @@
+There must not be a page break after this line of text.
+This test should produce only one page of output.
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-before-001.html b/LayoutTests/printing/css2.1/page-break-before-001.html
new file mode 100644 (file)
index 0000000..bd467c5
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-before :auto</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<meta content="paged" name="flags">
+<meta content="The 'auto' value of the 'page-break-before' property neither forces nor forbids a page break before the box." name="assert">
+<style type="text/css">
+
+    div.noBreak {
+        page-break-before:always;
+        page-break-before:auto;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test', 0);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div>There must <strong>not</strong> be a page break after this line of text.</div>
+    <div class="noBreak" id="test">This test should produce only one page of output.</div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-before-002-expected.txt b/LayoutTests/printing/css2.1/page-break-before-002-expected.txt
new file mode 100644 (file)
index 0000000..7f3a6e3
--- /dev/null
@@ -0,0 +1,4 @@
+There must not be a page break after this line of text.
+This test should produce only one page of output.
+PASS
+
diff --git a/LayoutTests/printing/css2.1/page-break-before-002.html b/LayoutTests/printing/css2.1/page-break-before-002.html
new file mode 100644 (file)
index 0000000..a3db316
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-before inline elements</title>
+<link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<meta content="paged" name="flags">
+<meta content="The 'page-break-before' property applies to block-level elements only." name="assert">
+<style type="text/css">
+
+    div.noBreak {
+        page-break-before:always;
+        display:inline;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test', 0);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div>There must <strong>not</strong> be a page break after this line of text.</div>
+    <div class="noBreak" id="test">This test should produce only one page of output.</div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/css2.1/page-break-inside-000-expected.txt b/LayoutTests/printing/css2.1/page-break-inside-000-expected.txt
new file mode 100644 (file)
index 0000000..8acb885
--- /dev/null
@@ -0,0 +1,5 @@
+There must be a page break below between "FIRST" and "LAST"
+FIRST dummy dummy dummy dummy dummy dummy dummy dummy dummy FIRST
+FAIL expect page number is 0. Was -1
+FAIL expect page number is 1. Was 0
+
diff --git a/LayoutTests/printing/css2.1/page-break-inside-000.html b/LayoutTests/printing/css2.1/page-break-inside-000.html
new file mode 100644 (file)
index 0000000..23bda9d
--- /dev/null
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>CSS Test: page-break-inside:auto</title>
+<link rel="author" href="mailto:tclancy@revenution.com" title="Tom Clancy">
+<link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company">
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-height-property">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details">
+<meta content="paged" name="flags">
+<meta content="The 'auto' value of the 'page-break-inside' property neither forces nor forbids a page break inside the box." name="assert">
+<style type="text/css">
+    html,body {
+        font-size:12pt;
+        line-height:1;
+        height:100%;
+        margin:0;
+    }
+    .marginDiv1, .marginDiv2 {
+        height:50%;
+    }
+    .marginDiv2 {
+        margin-top:-5em;
+    }
+    div.break {
+        page-break-inside:auto;
+        width:4em;
+    }
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberShouldBe('test1', 0);
+        pageNumberShouldBe('test2', 1);
+    }
+
+</script>
+</head>
+<body onload="test()">
+    <div class="marginDiv1"></div>
+    <div class="marginDiv2"></div>
+    <div>There must be a page break below between &quot;FIRST&quot; and &quot;LAST&quot;</div>
+    <div class="break">
+        <span id="test1">FIRST</span>
+        dummy
+        dummy
+        dummy
+        dummy
+        dummy
+        dummy
+        dummy
+        dummy
+        dummy
+        <span id="test2">FIRST</span>
+    </div>
+    <div id="results"></div>
+</body>
+</html>
diff --git a/LayoutTests/printing/resources/paged-media-test-utils.js b/LayoutTests/printing/resources/paged-media-test-utils.js
new file mode 100644 (file)
index 0000000..a79fbda
--- /dev/null
@@ -0,0 +1,10 @@
+function pageNumberShouldBe(id, expectedPageNumber)
+{
+    var actualPageNumber = layoutTestController.pageNumberForElementById(id);
+    var result = '';
+    if (actualPageNumber == expectedPageNumber)
+        result = 'PASS';
+    else
+        result = 'FAIL expect page number is ' + expectedPageNumber + '. Was ' + actualPageNumber;
+    document.getElementById('results').innerHTML += result + '<br>';
+}