Changeset 55275 in webkit
- Timestamp:
- Feb 26, 2010 2:40:17 AM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 1 added
- 19 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55274 r55275 1 2010-02-26 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Refine LayoutTests/printing/css2.1 with numberOfPages 6 https://bugs.webkit.org/show_bug.cgi?id=35334 7 8 Small refinements were done in paged-media-test-utils.js. 9 10 Note that WebKit doesn't pass page-break-after-003 for now. 11 12 * printing/css2.1/README.txt: 13 * printing/css2.1/page-break-after-000-expected.txt: 14 * printing/css2.1/page-break-after-000.html: 15 * printing/css2.1/page-break-after-001-expected.txt: 16 * printing/css2.1/page-break-after-001.html: 17 * printing/css2.1/page-break-after-002-expected.txt: 18 * printing/css2.1/page-break-after-002.html: 19 * printing/css2.1/page-break-after-003-expected.txt: Added. 20 * printing/css2.1/page-break-after-003.html: Added. 21 * printing/css2.1/page-break-after-004-expected.txt: 22 * printing/css2.1/page-break-after-004.html: 23 * printing/css2.1/page-break-before-000-expected.txt: 24 * printing/css2.1/page-break-before-000.html: 25 * printing/css2.1/page-break-before-001-expected.txt: 26 * printing/css2.1/page-break-before-001.html: 27 * printing/css2.1/page-break-before-002-expected.txt: 28 * printing/css2.1/page-break-before-002.html: 29 * printing/css2.1/page-break-inside-000-expected.txt: 30 * printing/css2.1/page-break-inside-000.html: 31 * printing/resources/paged-media-test-utils.js: 32 (appendResult): 33 (pageNumberForElementShouldBe): 34 (numberOfPagesShouldBe): 35 (runPrintingTest): 36 1 37 2010-02-26 Philippe Normand <pnormand@igalia.com> 2 38 -
trunk/LayoutTests/printing/css2.1/README.txt
r54538 r55275 11 11 - Add dumpAsText() call. 12 12 - Add test() function and implement it using layoutTestController functions. 13 - Call test() function using runPrintintTest(test) from body's onload. 13 14 - Add id attributes for elements in question. 14 - Add <div id="results"> to report the test results.15 16 FIXME: We have no way to get the number of last page for now.17 Though page-break-before-003 is actually failing, we cannot add18 failing test due to the lack of this feature.19 15 20 16 FIXME: page-margin-* aren't added yet. We may need -
trunk/LayoutTests/printing/css2.1/page-break-after-000-expected.txt
r54538 r55275 1 1 There must be a page break after this paragraph, followed by another line of content. This test should produce two pages of output. 2 2 This text should be at the top of the second and final page. 3 PASS4 3 4 PASS: page number of "test" is 1 5 PASS: number of pages is 2 6 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-after-000.html
r54538 r55275 24 24 function test() 25 25 { 26 pageNumberShouldBe('test', 1); 26 pageNumberForElementShouldBe('test', 1); 27 numberOfPagesShouldBe(2); 27 28 } 28 29 29 30 </script> 30 31 </head> 31 <body onload=" test()">32 <body onload="runPrintingTest(test)"> 32 33 <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> 33 34 <div id="test"> 34 35 This text should be at the top of the second and final page. 35 36 </div> 36 <div id="results"></div>37 37 </body> 38 38 </html> -
trunk/LayoutTests/printing/css2.1/page-break-after-001-expected.txt
r54538 r55275 1 1 There must not be a page break after this line of text. 2 2 This test should produce only one page of output. 3 PASS4 3 4 PASS: page number of "test" is 0 5 PASS: number of pages is 1 6 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-after-001.html
r54538 r55275 23 23 function test() 24 24 { 25 pageNumberShouldBe('test', 0); 25 pageNumberForElementShouldBe('test', 0); 26 numberOfPagesShouldBe(1); 26 27 } 27 28 28 29 </script> 29 30 </head> 30 <body onload=" test()">31 <body onload="runPrintingTest(test)"> 31 32 <div class="noBreak">There must <strong>not</strong> be a page break after this line of text.</div> 32 33 <div id="test">This test should produce only one page of output.</div> 33 <div id="results"></div>34 34 </body> 35 35 </html> -
trunk/LayoutTests/printing/css2.1/page-break-after-002-expected.txt
r54538 r55275 4 4 This sentence must be either on the second or on the third page. 5 5 6 PASS7 PASS8 6 7 PASS: page number of "test1" is 1 8 PASS: page number of "test2" is 1 9 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-after-002.html
r54538 r55275 23 23 function test() 24 24 { 25 pageNumber ShouldBe('test1', 1);25 pageNumberForElementShouldBe('test1', 1); 26 26 // As of February 2010, CSS spec says user agents may apply 27 27 // page-break-* to inline boxes. Though we are using 1 as the 28 28 // expected page number, 2 should be also OK. 29 pageNumber ShouldBe('test2', 1);29 pageNumberForElementShouldBe('test2', 1); 30 30 } 31 31 32 32 </script> 33 33 </head> 34 <body onload=" test()">34 <body onload="runPrintingTest(test)"> 35 35 <p>This sentence must be on the first page.</p> 36 36 <p class="noBreak" id="test1">This sentence must be on the second page.</p> 37 37 <p id="test2">This sentence must be either on the second or on the third page.</p> 38 <div id="results"></div>39 40 38 </body> 41 39 </html> -
trunk/LayoutTests/printing/css2.1/page-break-after-003.html
r55274 r55275 3 3 <head> 4 4 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 5 <title>CSS Test: page-break-after : always</title>5 <title>CSS Test: page-break-after (no inherit)</title> 6 6 <link rel="author" href="mailto:mturnwall@revenution.com" title="Michael Turnwall"> 7 7 <link rel="author" href="http://www.hp.com/" title="Hewlett-Packard Company"> 8 8 <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"> 9 9 <meta content="paged" name="flags"> 10 <meta content="The ' always' value of the 'page-break-after' property forces a page break after the box." name="assert">10 <meta content="The 'page-break-after' property is not inherited." name="assert"> 11 11 <style type="text/css"> 12 12 13 div .break{13 div { 14 14 page-break-after:always; 15 15 } … … 24 24 function test() 25 25 { 26 pageNumberShouldBe('test', 1); 26 pageNumberForElementShouldBe('test1', 0); 27 pageNumberForElementShouldBe('test2', 1); 28 numberOfPagesShouldBe(2); 27 29 } 28 30 29 31 </script> 30 32 </head> 31 <body onload="test()"> 32 <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> 33 <div id="test"> 33 <body onload="runPrintingTest(test)"> 34 <div> 35 <p>There must <strong>not</strong> be a page break after this line of text.</p> 36 <span id="test1">This test should produce two pages of output.</span> 37 </div> 38 <div id="test2"> 34 39 This text should be at the top of the second and final page. 35 40 </div> 36 <div id="results"></div>37 41 </body> 38 42 </html> -
trunk/LayoutTests/printing/css2.1/page-break-after-004-expected.txt
r54538 r55275 4 4 This must be the last sentence on the second and final page. 5 5 6 PASS7 PASS8 6 7 PASS: page number of "test1" is 1 8 PASS: page number of "test2" is 1 9 PASS: number of pages is 2 10 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-after-004.html
r54538 r55275 35 35 function test() 36 36 { 37 pageNumberShouldBe('test1', 1); 38 pageNumberShouldBe('test2', 1); 37 pageNumberForElementShouldBe('test1', 1); 38 pageNumberForElementShouldBe('test2', 1); 39 numberOfPagesShouldBe(2); 39 40 } 40 41 41 42 </script> 42 43 </head> 43 <body onload=" test()">44 <body onload="runPrintingTest(test)"> 44 45 <div class="noBreakAuto">This test must produce two pages of output. This sentence must be on the first page.</div> 45 46 <div class="noBreakLeft" id="test1">This sentence must be at the top of the second page.</div> 46 47 <div class="noBreakAlways dummy">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div> 47 48 <p id="test2">This must be the last sentence on the second and final page.</p> 48 <div id="results"></div>49 49 </body> 50 50 </html> -
trunk/LayoutTests/printing/css2.1/page-break-before-000-expected.txt
r54538 r55275 1 1 This test should produce two pages of output. This text should be at the top of the first page. 2 2 This text should be at the top of the second and final page. 3 PASS4 3 4 PASS: page number of "test1" is 0 5 PASS: page number of "test2" is 1 6 PASS: number of pages is 2 7 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-before-000.html
r54538 r55275 25 25 function test() 26 26 { 27 pageNumberShouldBe('test', 1); 27 pageNumberForElementShouldBe('test1', 0); 28 pageNumberForElementShouldBe('test2', 1); 29 numberOfPagesShouldBe(2); 28 30 } 29 31 30 32 </script> 31 33 </head> 32 <body onload="test()"> 33 <div>This test should produce two pages of output. This text should be at the top of the first page.</div> 34 <div class="break" id="test">This text should be at the top of the second and final page.</div> 35 <div id="results"></div> 34 <body onload="runPrintingTest(test)"> 35 <div id="test1">This test should produce two pages of output. This text should be at the top of the first page.</div> 36 <div class="break" id="test2">This text should be at the top of the second and final page.</div> 36 37 </body> 37 38 </html> -
trunk/LayoutTests/printing/css2.1/page-break-before-001-expected.txt
r54538 r55275 1 1 There must not be a page break after this line of text. 2 2 This test should produce only one page of output. 3 PASS4 3 4 PASS: page number of "test" is 0 5 PASS: number of pages is 1 6 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-before-001.html
r54538 r55275 25 25 function test() 26 26 { 27 pageNumberShouldBe('test', 0); 27 pageNumberForElementShouldBe('test', 0); 28 numberOfPagesShouldBe(1); 28 29 } 29 30 30 31 </script> 31 32 </head> 32 <body onload=" test()">33 <body onload="runPrintingTest(test)"> 33 34 <div>There must <strong>not</strong> be a page break after this line of text.</div> 34 35 <div class="noBreak" id="test">This test should produce only one page of output.</div> 35 <div id="results"></div>36 36 </body> 37 37 </html> -
trunk/LayoutTests/printing/css2.1/page-break-before-002-expected.txt
r54538 r55275 1 1 There must not be a page break after this line of text. 2 2 This test should produce only one page of output. 3 PASS4 3 4 PASS: page number of "test" is 0 5 PASS: number of pages is 1 6 All tests passed -
trunk/LayoutTests/printing/css2.1/page-break-before-002.html
r54538 r55275 25 25 function test() 26 26 { 27 pageNumberShouldBe('test', 0); 27 pageNumberForElementShouldBe('test', 0); 28 numberOfPagesShouldBe(1); 28 29 } 29 30 30 31 </script> 31 32 </head> 32 <body onload=" test()">33 <body onload="runPrintingTest(test)"> 33 34 <div>There must <strong>not</strong> be a page break after this line of text.</div> 34 35 <div class="noBreak" id="test">This test should produce only one page of output.</div> 35 <div id="results"></div>36 36 </body> 37 37 </html> -
trunk/LayoutTests/printing/css2.1/page-break-inside-000-expected.txt
r54538 r55275 1 1 There must be a page break below between "FIRST" and "LAST" 2 2 FIRST dummy dummy dummy dummy dummy dummy dummy dummy dummy FIRST 3 FAIL expect page number is 0. Was -14 FAIL expect page number is 1. Was 05 3 4 FAIL: expected page number of "test1" is 0. Was -1 5 FAIL: expected page number of "test2" is 1. Was 0 -
trunk/LayoutTests/printing/css2.1/page-break-inside-000.html
r54538 r55275 37 37 function test() 38 38 { 39 pageNumber ShouldBe('test1', 0);40 pageNumber ShouldBe('test2', 1);39 pageNumberForElementShouldBe('test1', 0); 40 pageNumberForElementShouldBe('test2', 1); 41 41 } 42 42 43 43 </script> 44 44 </head> 45 <body onload=" test()">45 <body onload="runPrintingTest(test)"> 46 46 <div class="marginDiv1"></div> 47 47 <div class="marginDiv2"></div> … … 60 60 <span id="test2">FIRST</span> 61 61 </div> 62 <div id="results"></div>63 62 </body> 64 63 </html> -
trunk/LayoutTests/printing/resources/paged-media-test-utils.js
r54538 r55275 1 function pageNumberShouldBe(id, expectedPageNumber) 1 // The buffer to store the results. We output the results after all 2 // tests finish. Note that we cannot have a DOM element where the 3 // results are stored in HTMLs because the DOM element to store 4 // results may change the number of pages. 5 var _results = ''; 6 var _errored = false; 7 8 function appendResult(result) 9 { 10 _results += '<br>' + result; 11 } 12 13 function pageNumberForElementShouldBe(id, expectedPageNumber) 2 14 { 3 15 var actualPageNumber = layoutTestController.pageNumberForElementById(id); 4 var result = '';5 16 if (actualPageNumber == expectedPageNumber) 6 result = 'PASS'; 7 else 8 result = 'FAIL expect page number is ' + expectedPageNumber + '. Was ' + actualPageNumber; 9 document.getElementById('results').innerHTML += result + '<br>'; 17 appendResult('PASS: page number of "' + id + '" is ' + actualPageNumber); 18 else { 19 appendResult('FAIL: expected page number of "' + id + '" is ' + expectedPageNumber + '. Was ' + actualPageNumber); 20 _errored = true; 21 } 10 22 } 23 24 function numberOfPagesShouldBe(expectedNumberOfPages) 25 { 26 var actualNumberOfPages = layoutTestController.numberOfPages(); 27 if (actualNumberOfPages == expectedNumberOfPages) 28 appendResult('PASS: number of pages is ' + actualNumberOfPages); 29 else { 30 appendResult('FAIL: expected number of pages is ' + expectedNumberOfPages + '. Was ' + actualNumberOfPages); 31 _errored = true; 32 } 33 } 34 35 function runPrintingTest(testFunction) 36 { 37 if (window.layoutTestController) { 38 try { 39 testFunction(); 40 } catch (err) { 41 _results += '<p>Exception: ' + err.toString(); 42 _errored = true; 43 } 44 45 if (!_errored) 46 _results += '<br>All tests passed'; 47 } else { 48 _results += 'This test requires layoutTestController. You can test this manually with the above description.'; 49 } 50 51 var resultElement = document.createElement('p'); 52 resultElement.innerHTML = _results; 53 document.body.appendChild(resultElement); 54 }
Note: See TracChangeset
for help on using the changeset viewer.