[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

hamaji at chromium.org hamaji at chromium.org
Thu Apr 8 01:59:55 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 2253074cf5aabf410b9c479d4ec52ab7b6b53696
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 10:40:17 2010 +0000

    2010-02-26  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Refine LayoutTests/printing/css2.1 with numberOfPages
            https://bugs.webkit.org/show_bug.cgi?id=35334
    
            Small refinements were done in paged-media-test-utils.js.
    
            Note that WebKit doesn't pass page-break-after-003 for now.
    
            * printing/css2.1/README.txt:
            * printing/css2.1/page-break-after-000-expected.txt:
            * printing/css2.1/page-break-after-000.html:
            * printing/css2.1/page-break-after-001-expected.txt:
            * printing/css2.1/page-break-after-001.html:
            * printing/css2.1/page-break-after-002-expected.txt:
            * printing/css2.1/page-break-after-002.html:
            * printing/css2.1/page-break-after-003-expected.txt: Added.
            * printing/css2.1/page-break-after-003.html: Added.
            * printing/css2.1/page-break-after-004-expected.txt:
            * printing/css2.1/page-break-after-004.html:
            * printing/css2.1/page-break-before-000-expected.txt:
            * printing/css2.1/page-break-before-000.html:
            * printing/css2.1/page-break-before-001-expected.txt:
            * printing/css2.1/page-break-before-001.html:
            * printing/css2.1/page-break-before-002-expected.txt:
            * printing/css2.1/page-break-before-002.html:
            * printing/css2.1/page-break-inside-000-expected.txt:
            * printing/css2.1/page-break-inside-000.html:
            * printing/resources/paged-media-test-utils.js:
            (appendResult):
            (pageNumberForElementShouldBe):
            (numberOfPagesShouldBe):
            (runPrintingTest):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6a67261..a2902cd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,39 @@
+2010-02-26  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Refine LayoutTests/printing/css2.1 with numberOfPages
+        https://bugs.webkit.org/show_bug.cgi?id=35334
+
+        Small refinements were done in paged-media-test-utils.js.
+
+        Note that WebKit doesn't pass page-break-after-003 for now.
+
+        * printing/css2.1/README.txt:
+        * printing/css2.1/page-break-after-000-expected.txt:
+        * printing/css2.1/page-break-after-000.html:
+        * printing/css2.1/page-break-after-001-expected.txt:
+        * printing/css2.1/page-break-after-001.html:
+        * printing/css2.1/page-break-after-002-expected.txt:
+        * printing/css2.1/page-break-after-002.html:
+        * printing/css2.1/page-break-after-003-expected.txt: Added.
+        * printing/css2.1/page-break-after-003.html: Added.
+        * printing/css2.1/page-break-after-004-expected.txt:
+        * printing/css2.1/page-break-after-004.html:
+        * printing/css2.1/page-break-before-000-expected.txt:
+        * printing/css2.1/page-break-before-000.html:
+        * printing/css2.1/page-break-before-001-expected.txt:
+        * printing/css2.1/page-break-before-001.html:
+        * printing/css2.1/page-break-before-002-expected.txt:
+        * printing/css2.1/page-break-before-002.html:
+        * printing/css2.1/page-break-inside-000-expected.txt:
+        * printing/css2.1/page-break-inside-000.html:
+        * printing/resources/paged-media-test-utils.js:
+        (appendResult):
+        (pageNumberForElementShouldBe):
+        (numberOfPagesShouldBe):
+        (runPrintingTest):
+
 2010-02-26  Philippe Normand  <pnormand at igalia.com>
 
         Rubber-stamped by Xan Lopez.
diff --git a/LayoutTests/printing/css2.1/README.txt b/LayoutTests/printing/css2.1/README.txt
index bf153d9..f2b5fb4 100644
--- a/LayoutTests/printing/css2.1/README.txt
+++ b/LayoutTests/printing/css2.1/README.txt
@@ -10,12 +10,8 @@ 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.
+- Call test() function using runPrintintTest(test) from body's onload.
 - 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
index e1b3d85..41701b5 100644
--- a/LayoutTests/printing/css2.1/page-break-after-000-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-after-000-expected.txt
@@ -1,4 +1,6 @@
 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
 
+PASS: page number of "test" is 1
+PASS: number of pages is 2
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-after-000.html b/LayoutTests/printing/css2.1/page-break-after-000.html
index 1919b62..f2610a3 100644
--- a/LayoutTests/printing/css2.1/page-break-after-000.html
+++ b/LayoutTests/printing/css2.1/page-break-after-000.html
@@ -23,16 +23,16 @@
 
     function test()
     {
-        pageNumberShouldBe('test', 1);
+        pageNumberForElementShouldBe('test', 1);
+        numberOfPagesShouldBe(2);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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
index 7f3a6e3..7118079 100644
--- a/LayoutTests/printing/css2.1/page-break-after-001-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-after-001-expected.txt
@@ -1,4 +1,6 @@
 There must not be a page break after this line of text.
 This test should produce only one page of output.
-PASS
 
+PASS: page number of "test" is 0
+PASS: number of pages is 1
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-after-001.html b/LayoutTests/printing/css2.1/page-break-after-001.html
index daff7d9..ac07c40 100644
--- a/LayoutTests/printing/css2.1/page-break-after-001.html
+++ b/LayoutTests/printing/css2.1/page-break-after-001.html
@@ -22,14 +22,14 @@
 
     function test()
     {
-        pageNumberShouldBe('test', 0);
+        pageNumberForElementShouldBe('test', 0);
+        numberOfPagesShouldBe(1);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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
index 5b1222e..7998011 100644
--- a/LayoutTests/printing/css2.1/page-break-after-002-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-after-002-expected.txt
@@ -3,6 +3,7 @@ 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
 
+PASS: page number of "test1" is 1
+PASS: page number of "test2" is 1
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-after-002.html b/LayoutTests/printing/css2.1/page-break-after-002.html
index 1a7fcac..c3cff0c 100644
--- a/LayoutTests/printing/css2.1/page-break-after-002.html
+++ b/LayoutTests/printing/css2.1/page-break-after-002.html
@@ -22,20 +22,18 @@
 
     function test()
     {
-        pageNumberShouldBe('test1', 1);
+        pageNumberForElementShouldBe('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);
+        pageNumberForElementShouldBe('test2', 1);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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-003-expected.txt b/LayoutTests/printing/css2.1/page-break-after-003-expected.txt
new file mode 100644
index 0000000..34ba214
--- /dev/null
+++ b/LayoutTests/printing/css2.1/page-break-after-003-expected.txt
@@ -0,0 +1,8 @@
+There must not be a page break after this line of text.
+
+This test should produce two pages of output.
+This text should be at the top of the second and final page.
+
+PASS: page number of "test1" is 0
+PASS: page number of "test2" is 1
+FAIL: expected number of pages is 2. Was 3
diff --git a/LayoutTests/printing/css2.1/page-break-after-003.html b/LayoutTests/printing/css2.1/page-break-after-003.html
new file mode 100644
index 0000000..54805f9
--- /dev/null
+++ b/LayoutTests/printing/css2.1/page-break-after-003.html
@@ -0,0 +1,42 @@
+<!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 (no inherit)</title>
+<link rel="author" href="mailto:mturnwall at 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-after' property is not inherited." name="assert">
+<style type="text/css">
+
+    div {
+        page-break-after:always;
+    }
+
+</style>
+<script src="../resources/paged-media-test-utils.js"></script>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function test()
+    {
+        pageNumberForElementShouldBe('test1', 0);
+        pageNumberForElementShouldBe('test2', 1);
+        numberOfPagesShouldBe(2);
+    }
+
+</script>
+</head>
+<body onload="runPrintingTest(test)">
+    <div>
+        <p>There must <strong>not</strong> be a page break after this line of text.</p>
+        <span id="test1">This test should produce two pages of output.</span>
+    </div>
+    <div id="test2">
+        This text should be at the top of the second and final page.
+    </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
index cfad409..0611836 100644
--- a/LayoutTests/printing/css2.1/page-break-after-004-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-after-004-expected.txt
@@ -3,6 +3,8 @@ 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
 
+PASS: page number of "test1" is 1
+PASS: page number of "test2" is 1
+PASS: number of pages is 2
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-after-004.html b/LayoutTests/printing/css2.1/page-break-after-004.html
index 8010d00..1c79230 100644
--- a/LayoutTests/printing/css2.1/page-break-after-004.html
+++ b/LayoutTests/printing/css2.1/page-break-after-004.html
@@ -34,17 +34,17 @@
 
     function test()
     {
-        pageNumberShouldBe('test1', 1);
-        pageNumberShouldBe('test2', 1);
+        pageNumberForElementShouldBe('test1', 1);
+        pageNumberForElementShouldBe('test2', 1);
+        numberOfPagesShouldBe(2);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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
index 05f066a..d89b855 100644
--- a/LayoutTests/printing/css2.1/page-break-before-000-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-before-000-expected.txt
@@ -1,4 +1,7 @@
 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
 
+PASS: page number of "test1" is 0
+PASS: page number of "test2" is 1
+PASS: number of pages is 2
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-before-000.html b/LayoutTests/printing/css2.1/page-break-before-000.html
index ae35ded..718a373 100644
--- a/LayoutTests/printing/css2.1/page-break-before-000.html
+++ b/LayoutTests/printing/css2.1/page-break-before-000.html
@@ -24,14 +24,15 @@
 
     function test()
     {
-        pageNumberShouldBe('test', 1);
+        pageNumberForElementShouldBe('test1', 0);
+        pageNumberForElementShouldBe('test2', 1);
+        numberOfPagesShouldBe(2);
     }
 
 </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 onload="runPrintingTest(test)">
+    <div id="test1">This test should produce two pages of output. This text should be at the top of the first page.</div>
+    <div class="break" id="test2">This text should be at the top of the second and final page.</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
index 7f3a6e3..7118079 100644
--- a/LayoutTests/printing/css2.1/page-break-before-001-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-before-001-expected.txt
@@ -1,4 +1,6 @@
 There must not be a page break after this line of text.
 This test should produce only one page of output.
-PASS
 
+PASS: page number of "test" is 0
+PASS: number of pages is 1
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-before-001.html b/LayoutTests/printing/css2.1/page-break-before-001.html
index bd467c5..1fed03a 100644
--- a/LayoutTests/printing/css2.1/page-break-before-001.html
+++ b/LayoutTests/printing/css2.1/page-break-before-001.html
@@ -24,14 +24,14 @@
 
     function test()
     {
-        pageNumberShouldBe('test', 0);
+        pageNumberForElementShouldBe('test', 0);
+        numberOfPagesShouldBe(1);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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
index 7f3a6e3..7118079 100644
--- a/LayoutTests/printing/css2.1/page-break-before-002-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-before-002-expected.txt
@@ -1,4 +1,6 @@
 There must not be a page break after this line of text.
 This test should produce only one page of output.
-PASS
 
+PASS: page number of "test" is 0
+PASS: number of pages is 1
+All tests passed
diff --git a/LayoutTests/printing/css2.1/page-break-before-002.html b/LayoutTests/printing/css2.1/page-break-before-002.html
index a3db316..631f908 100644
--- a/LayoutTests/printing/css2.1/page-break-before-002.html
+++ b/LayoutTests/printing/css2.1/page-break-before-002.html
@@ -24,14 +24,14 @@
 
     function test()
     {
-        pageNumberShouldBe('test', 0);
+        pageNumberForElementShouldBe('test', 0);
+        numberOfPagesShouldBe(1);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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
index 8acb885..dc28776 100644
--- a/LayoutTests/printing/css2.1/page-break-inside-000-expected.txt
+++ b/LayoutTests/printing/css2.1/page-break-inside-000-expected.txt
@@ -1,5 +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
 
+FAIL: expected page number of "test1" is 0. Was -1
+FAIL: expected page number of "test2" 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
index 23bda9d..3f9b6cf 100644
--- a/LayoutTests/printing/css2.1/page-break-inside-000.html
+++ b/LayoutTests/printing/css2.1/page-break-inside-000.html
@@ -36,13 +36,13 @@
 
     function test()
     {
-        pageNumberShouldBe('test1', 0);
-        pageNumberShouldBe('test2', 1);
+        pageNumberForElementShouldBe('test1', 0);
+        pageNumberForElementShouldBe('test2', 1);
     }
 
 </script>
 </head>
-<body onload="test()">
+<body onload="runPrintingTest(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>
@@ -59,6 +59,5 @@
         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
index a79fbda..1619298 100644
--- a/LayoutTests/printing/resources/paged-media-test-utils.js
+++ b/LayoutTests/printing/resources/paged-media-test-utils.js
@@ -1,10 +1,54 @@
-function pageNumberShouldBe(id, expectedPageNumber)
+// The buffer to store the results.  We output the results after all
+// tests finish.   Note that we cannot have a DOM element where the
+// results are stored in HTMLs because the DOM element to store
+// results may change the number of pages.
+var _results = '';
+var _errored = false;
+
+function appendResult(result)
+{
+    _results += '<br>' + result;
+}
+
+function pageNumberForElementShouldBe(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>';
+        appendResult('PASS: page number of "' + id + '" is ' + actualPageNumber);
+    else {
+        appendResult('FAIL: expected page number of "' + id + '" is ' + expectedPageNumber + '. Was ' + actualPageNumber);
+        _errored = true;
+    }
+}
+
+function numberOfPagesShouldBe(expectedNumberOfPages)
+{
+    var actualNumberOfPages = layoutTestController.numberOfPages();
+    if (actualNumberOfPages == expectedNumberOfPages)
+        appendResult('PASS: number of pages is ' + actualNumberOfPages);
+    else {
+        appendResult('FAIL: expected number of pages is ' + expectedNumberOfPages + '. Was ' + actualNumberOfPages);
+        _errored = true;
+    }
+}
+
+function runPrintingTest(testFunction)
+{
+    if (window.layoutTestController) {
+        try {
+            testFunction();
+        } catch (err) {
+            _results += '<p>Exception: ' + err.toString();
+            _errored = true;
+        }
+
+        if (!_errored)
+            _results += '<br>All tests passed';
+    } else {
+        _results += 'This test requires layoutTestController. You can test this manually with the above description.';
+    }
+
+    var resultElement = document.createElement('p');
+    resultElement.innerHTML = _results;
+    document.body.appendChild(resultElement);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list