Merge split script tests
https://bugs.webkit.org/show_bug.cgi?id=172423

Reviewed by Sam Weinig.

In the past, many tests were being split into HTML and JS parts for no good reason.
This makes it hard to see what those tests are doing.

This is first part of the change, only including files where JS and HTML counterparts
have matching names. Custom cases will be completed in a follow-up.

Long change list omitted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@217390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/printing/allowed-page-breaks.html b/LayoutTests/printing/allowed-page-breaks.html
index 4733a90..7a882ec 100644
--- a/LayoutTests/printing/allowed-page-breaks.html
+++ b/LayoutTests/printing/allowed-page-breaks.html
@@ -8,7 +8,34 @@
 <p id="description"></p>
 <div id="console"></div>
 <div id="sandbox"></div>
-<script src="script-tests/allowed-page-breaks.js"></script>
+<script>
+description("Test for allowed page breaks");
+
+function test()
+{
+    // See CSS3: Paged Media 9.4. Allowed page breaks.
+    // http://dev.w3.org/csswg/css3-page/#allowed-pg-brk
+    createBlockWithRatioToPageHeight("page1", 0.8).style.pageBreakBefore = "always";
+    // We shoud break a page between block 'page1' and block 'page2' instead of
+    // breaking inside block 'page2' because there is no allowed page break points
+    // inside block 'page2'. Breaking at non-allowed position should be a last resort.
+    createBlockWithRatioToPageHeight("page2", 0.8);
+
+    createBlockWithRatioToPageHeight("page3-1", 0.6).style.pageBreakBefore = "always";
+    // We can break inside block 'page3-2' because page breaks may occur between
+    // line boxes inside a block box.
+    createBlockWithNumberOfLines("page3-2", 20);
+
+    pageNumberForElementShouldBe("page1", 1);
+    pageNumberForElementShouldBe("page2", 2);
+    pageNumberForElementShouldBe("page3-1", 3);
+    pageNumberForElementShouldBe("page3-2", 3);
+
+    document.body.removeChild(document.getElementById("sandbox"));
+}
+
+var successfullyParsed = true;
+</script>
 <script>runPrintingTest(test);</script>
 <script src="../resources/js-test-post.js"></script>
 </body>