png-partial-load-as-document.html 853 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <iframe style="background-color: blue; width: 320px; height: 240px;"></iframe>
  2. <!--
  3. Tests that when a progressive png is loaded as document, the image is shown
  4. progressively during loading.
  5. The result image should show the dice image partially.
  6. -->
  7. <script>
  8. if (window.testRunner)
  9. testRunner.waitUntilDone();
  10. function loadAndStall()
  11. {
  12. return "http://127.0.0.1:8000/resources/load-and-stall.php";
  13. }
  14. function pngImage()
  15. {
  16. return "?name=../../../images/resources/dice.png&mimeType=image%2Fpng";
  17. }
  18. function testDone()
  19. {
  20. if (window.testRunner) {
  21. window.stop();
  22. testRunner.notifyDone();
  23. }
  24. }
  25. function runTest()
  26. {
  27. document.querySelector("iframe").src = loadAndStall() + pngImage() + "&stallAt=45057&stallFor=60";
  28. setTimeout(testDone, 1500);
  29. }
  30. window.onload = function() {
  31. setTimeout(runTest, 0);
  32. }
  33. </script>