Add partial load test for JPEG image
authornoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 06:59:41 +0000 (06:59 +0000)
committernoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 06:59:41 +0000 (06:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98487

Reviewed by Adam Barth.

Partial load test: receive a partial number of image bytes and stall forever.  The partial
image should be decoded and drawn and the green <img> background should be visible.

* fast/images/resources/lenna.jpg: Added.
* http/tests/images/jpeg-partial-load-expected.png: Added.
* http/tests/images/jpeg-partial-load-expected.txt: Added.
* http/tests/images/jpeg-partial-load.html: Added.
* platform/chromium/http/tests/images/jpeg-partial-load-expected.png: Added.
* platform/mac/http/tests/images/jpeg-partial-load-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130618 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/images/resources/lenna.jpg [new file with mode: 0644]
LayoutTests/http/tests/images/jpeg-partial-load-expected.png [new file with mode: 0644]
LayoutTests/http/tests/images/jpeg-partial-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/images/jpeg-partial-load.html [new file with mode: 0644]
LayoutTests/platform/chromium/http/tests/images/jpeg-partial-load-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/http/tests/images/jpeg-partial-load-expected.png [new file with mode: 0644]

index b9b34e6c67b34164a4ce91176c3baacdf1fdfe26..ed3fc7563bb40a918d3f8b87756284d1d2a05f01 100644 (file)
@@ -1,3 +1,20 @@
+2012-10-07  Noel Gordon  <noel.gordon@gmail.com>
+
+        Add partial load test for JPEG image
+        https://bugs.webkit.org/show_bug.cgi?id=98487
+
+        Reviewed by Adam Barth.
+
+        Partial load test: receive a partial number of image bytes and stall forever.  The partial
+        image should be decoded and drawn and the green <img> background should be visible.
+
+        * fast/images/resources/lenna.jpg: Added.
+        * http/tests/images/jpeg-partial-load-expected.png: Added.
+        * http/tests/images/jpeg-partial-load-expected.txt: Added.
+        * http/tests/images/jpeg-partial-load.html: Added.
+        * platform/chromium/http/tests/images/jpeg-partial-load-expected.png: Added.
+        * platform/mac/http/tests/images/jpeg-partial-load-expected.png: Added.
+
 2012-10-07  Arpita Bahuguna  <arpitabahuguna@gmail.com>
 
         :first-line pseudo selector ignoring words created from :before
 2012-10-07  Arpita Bahuguna  <arpitabahuguna@gmail.com>
 
         :first-line pseudo selector ignoring words created from :before
diff --git a/LayoutTests/fast/images/resources/lenna.jpg b/LayoutTests/fast/images/resources/lenna.jpg
new file mode 100644 (file)
index 0000000..fd6178e
Binary files /dev/null and b/LayoutTests/fast/images/resources/lenna.jpg differ
diff --git a/LayoutTests/http/tests/images/jpeg-partial-load-expected.png b/LayoutTests/http/tests/images/jpeg-partial-load-expected.png
new file mode 100644 (file)
index 0000000..8bc9cdb
Binary files /dev/null and b/LayoutTests/http/tests/images/jpeg-partial-load-expected.png differ
diff --git a/LayoutTests/http/tests/images/jpeg-partial-load-expected.txt b/LayoutTests/http/tests/images/jpeg-partial-load-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/http/tests/images/jpeg-partial-load.html b/LayoutTests/http/tests/images/jpeg-partial-load.html
new file mode 100644 (file)
index 0000000..3ff1846
--- /dev/null
@@ -0,0 +1,30 @@
+<img style="background: green" >
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText(true);
+    testRunner.waitUntilDone();
+}
+
+function loadAndStall()
+{
+    return "http://127.0.0.1:8000/resources/load-and-stall.php";
+}
+
+function jpegImage()
+{
+    return "?name=../../../fast/images/resources/lenna.jpg&mimeType=image%2Fjpeg";
+}
+
+function testDone()
+{
+    window.testRunner && testRunner.notifyDone();
+}
+
+function runTest()
+{
+    document.querySelector("img").src = loadAndStall() + jpegImage() + "&stallAt=14337&stallFor=60";
+    setTimeout(testDone, 500);
+}
+
+setTimeout(runTest, 0);
+</script>
diff --git a/LayoutTests/platform/chromium/http/tests/images/jpeg-partial-load-expected.png b/LayoutTests/platform/chromium/http/tests/images/jpeg-partial-load-expected.png
new file mode 100644 (file)
index 0000000..8bc9cdb
Binary files /dev/null and b/LayoutTests/platform/chromium/http/tests/images/jpeg-partial-load-expected.png differ
diff --git a/LayoutTests/platform/mac/http/tests/images/jpeg-partial-load-expected.png b/LayoutTests/platform/mac/http/tests/images/jpeg-partial-load-expected.png
new file mode 100644 (file)
index 0000000..1a27865
Binary files /dev/null and b/LayoutTests/platform/mac/http/tests/images/jpeg-partial-load-expected.png differ