Skip to content

Commit

Permalink
Make printing/single-line-must-not-be-split-[...].html actually "print".
Browse files Browse the repository at this point in the history
At some point [1] it ceased to be a printing test, so it didn't really
test anything useful. Make sure that we enter print mode, and turn it
into a PNG test. Reduce the number of lines and use the Ahem font, to
keep the PNG file sizes low.

Mark the test as failing with LayoutNGBlockFragmentation. It used to
pass because there was no block fragmentation involved in the test.

[1] df18d7a

Change-Id: I5a17d76b53515975c90020bd37639f0af4563130
Reviewed-on: https://chromium-review.googlesource.com/c/1371868
Reviewed-by: Aleks Totic <atotic@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615976}
  • Loading branch information
mstensho authored and Commit Bot committed Dec 12, 2018
1 parent dbeccd0 commit cf2439b
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 12,089 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ crbug.com/591099 paint/invalidation/svg/transform-focus-ring-repaint.html [ Fail
crbug.com/591099 paint/invalidation/table/table-extra-bottom-grow.html [ Failure ]
crbug.com/591099 paint/invalidation/table/table-two-pass-layout-overpaint.html [ Failure ]
crbug.com/591099 printing/iframe-svg-in-object-print.html [ Failure ]
crbug.com/591099 printing/single-line-must-not-be-split-into-two-pages.html [ Failure ]
crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
crbug.com/591099 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
crbug.com/591099 svg/zoom/page/zoom-svg-float-border-padding.xml [ Pass ]
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/web_tests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,7 @@ crbug.com/591099 virtual/layout_ng_experimental/printing/page-break-widows.html
crbug.com/591099 virtual/layout_ng_experimental/printing/page-count-relayout-shrink.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/printing/respect-layout-overflow-from-pagination.html [ Failure ]
crbug.com/824918 virtual/layout_ng_experimental/printing/setPrinting.html [ Failure ]
crbug.com/829028 virtual/layout_ng_experimental/printing/single-line-must-not-be-split-into-two-pages.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/printing/tfoot-repeats-at-bottom-of-each-page-multiple-tables.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/printing/thead-repeat-in-nested-table.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/printing/thead-repeats-at-top-of-each-page.html [ Failure ]
Expand Down

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,50 +1,34 @@
<html>
<head>
</head>
<!DOCTYPE html>
<script src="../resources/ahem.js"></script>
<style>
/* relative positioning ensures underlying Layer */
.renderingArea {
position: relative;
font: 70px/1 Ahem;
line-height: 100px;
}
</style>
<body>
<p>
A single line must not be split into two pages.
This test checks if a single line is not split into two pages.
To run this test manually, comment out the last two lines of JavaScript
(See the comment in JavaScript) and then print this page.
If no lines are split into two pages, the test passes.
To run this test manually, print this page.
</p>
<div class="renderingArea" id="renderingArea1"></div>
<h2>And now for some really long unbreakable lines:</h2>
<div class="renderingArea" id="renderingArea2"></div>
<p>Non-overflowed lines:</p>
<pre id="nonOverflowedLines"></pre>
<p>Overflowed lines:</p>
<pre id="overflowedLines"></pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
testRunner.setPrinting();

var str = "";
for (var i = 0; i < 400; i++) {
for (var i = 0; i < 30; i++) {
str += "WWWWWW<br />";
}
document.getElementById("renderingArea1").innerHTML = str;
if (window.internals)
document.getElementById("nonOverflowedLines").innerText = internals.elementLayoutTreeAsText(document.getElementById("renderingArea1"));

str = "";
for (var i = 0; i < 400; i++) {
for (var i = 0; i < 30; i++) {
str += "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW<br />";
}
document.getElementById("renderingArea2").innerHTML = str;
if (window.internals)
document.getElementById("overflowedLines").innerText = internals.elementLayoutTreeAsText(document.getElementById("renderingArea2"));

// To test manually, comment out the following two lines,
// print this page, and check if no lines are split across two pages.
document.getElementById("renderingArea1").innerHTML = "";
document.getElementById("renderingArea2").innerHTML = "";
</script>
</body>
</html>

0 comments on commit cf2439b

Please sign in to comment.