Add partial load test for PNG images with no alpha
authornoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Sep 2012 04:27:46 +0000 (04:27 +0000)
committernoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Sep 2012 04:27:46 +0000 (04:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=96064

Reviewed by Simon Fraser.

Partial load test for a PNG image with no alpha: 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.png: Added: this PNG image has no alpha.
* http/tests/images/png-partial-load-no-alpha-expected.png: Added.
* http/tests/images/png-partial-load-no-alpha-expected.txt: Added.
* http/tests/images/png-partial-load-no-alpha.html: Added.
* platform/chromium/http/tests/images/png-partial-load-no-alpha-expected.png: Added.
* platform/mac/TestExpectations: Add an IMAGE failure for the mac port.

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

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

index 0745cce9f759a6bdc1da02960a13a23b69cec3dd..5780d0e969ed392fd368c6682d26f299ebf76a63 100644 (file)
@@ -1,3 +1,21 @@
+2012-09-19  Noel Gordon  <noel.gordon@gmail.com>
+
+        Add partial load test for PNG images with no alpha
+        https://bugs.webkit.org/show_bug.cgi?id=96064
+
+        Reviewed by Simon Fraser.
+
+        Partial load test for a PNG image with no alpha: 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.png: Added: this PNG image has no alpha.
+        * http/tests/images/png-partial-load-no-alpha-expected.png: Added.
+        * http/tests/images/png-partial-load-no-alpha-expected.txt: Added.
+        * http/tests/images/png-partial-load-no-alpha.html: Added.
+        * platform/chromium/http/tests/images/png-partial-load-no-alpha-expected.png: Added.
+        * platform/mac/TestExpectations: Add an IMAGE failure for the mac port.
+
 2012-09-19  Simon Fraser  <simon.fraser@apple.com>
 
         Attempt to unskip some tests by removing them from the Skipped list.
diff --git a/LayoutTests/fast/images/resources/lenna.png b/LayoutTests/fast/images/resources/lenna.png
new file mode 100644 (file)
index 0000000..21b31db
Binary files /dev/null and b/LayoutTests/fast/images/resources/lenna.png differ
diff --git a/LayoutTests/http/tests/images/png-partial-load-no-alpha-expected.png b/LayoutTests/http/tests/images/png-partial-load-no-alpha-expected.png
new file mode 100644 (file)
index 0000000..a6728a1
Binary files /dev/null and b/LayoutTests/http/tests/images/png-partial-load-no-alpha-expected.png differ
diff --git a/LayoutTests/http/tests/images/png-partial-load-no-alpha-expected.txt b/LayoutTests/http/tests/images/png-partial-load-no-alpha-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/http/tests/images/png-partial-load-no-alpha.html b/LayoutTests/http/tests/images/png-partial-load-no-alpha.html
new file mode 100644 (file)
index 0000000..44c318f
--- /dev/null
@@ -0,0 +1,31 @@
+<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 pngImage()
+{
+    return "?name=../../../fast/images/resources/lenna.png&mimeType=image%2Fpng";
+}
+
+function testDone()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function runTest()
+{
+    document.querySelector("img").src = loadAndStall() + pngImage() + "&stallAt=55297&stallFor=60";
+    setTimeout(testDone, 500);
+}
+
+setTimeout(runTest, 0);
+</script>
diff --git a/LayoutTests/platform/chromium/http/tests/images/png-partial-load-no-alpha-expected.png b/LayoutTests/platform/chromium/http/tests/images/png-partial-load-no-alpha-expected.png
new file mode 100644 (file)
index 0000000..a6728a1
Binary files /dev/null and b/LayoutTests/platform/chromium/http/tests/images/png-partial-load-no-alpha-expected.png differ
index 5994fe87deca7dfb94d8d76e1d2baec4af06f5cc..b776d1d2e50c18d08446dd8e2084e14126e96693 100644 (file)
@@ -347,3 +347,5 @@ webkit.org/b/95501 http/tests/security/inactive-document-with-empty-security-ori
 
 
 
+// Paints black behind the test image instead of the expected green.
+BUGWK95707 : http/tests/images/png-partial-load-no-alpha.html = IMAGE