<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/paged-media-test-utils.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<div id="sandbox"></div>
<script>
description("Test for internals.pageNumber()");

function test()
{
    // Assuming that one page has about 20 lines.
    createBlockWithNumberOfLines("firstPage", 20);
    createBlockWithNumberOfLines("secondPage", 20);

    createBlockWithNumberOfLines("thirdPage", 5);
    createBlockWithNumberOfLines("thirdPage2", 5);

    pageNumberForElementShouldBe('firstPage', 0);
    pageNumberForElementShouldBe('secondPage', 1);
    pageNumberForElementShouldBe('thirdPage', 2);
    pageNumberForElementShouldBe('thirdPage2', 2);

    document.body.removeChild(document.getElementById("sandbox"));
}

var successfullyParsed = true;
</script>
<script>runPrintingTest(test);</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
