Bug 1316629 - migrate dom/html/test/test_img_complete.html to web-platform-test. r=jgraham
authorJoel Maher <jmaher@mozilla.com>
Wed, 16 Nov 2016 09:43:53 -0500
changeset 322844 55fe392732ac5758b488728db4c854b1488a2445
parent 322843 120a628d89b841427e56435f521b785d0e5f6ece
child 322845 efe1e3b8cc1714dbdc456b80dfa4578a5192f5b7
push id30961
push userkwierso@gmail.com
push dateThu, 17 Nov 2016 01:08:03 +0000
treeherdermozilla-central@c27117f67fa3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1316629
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316629 - migrate dom/html/test/test_img_complete.html to web-platform-test. r=jgraham MozReview-Commit-ID: 7tyxMzVQ1g2
dom/html/test/mochitest.ini
dom/html/test/test_img_complete.html
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png
testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -575,17 +575,16 @@ support-files = file_cookiemanager.js
 [test_bug765780.html]
 [test_bug871161.html]
 support-files = file_bug871161-1.html file_bug871161-2.html
 [test_bug1013316.html]
 [test_hash_encoded.html]
 [test_bug1081037.html]
 [test_window_open_close.html]
 tags = openwindow
-[test_img_complete.html]
 [test_viewport_resize.html]
 [test_image_clone_load.html]
 [test_bug1203668.html]
 [test_bug1166138.html]
 [test_bug1230665.html]
 [test_filepicker_default_directory.html]
 skip-if = toolkit == 'android'
 [test_bug1233598.html]
deleted file mode 100644
--- a/dom/html/test/test_img_complete.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=608261
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 608261</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-  /** Test for Bug 608261 **/
-  SimpleTest.waitForExplicitFinish();
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=608261">Mozilla Bug 608261</a>
-<p id="display"><img src="image.png"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-  <script type="application/javascript">
-    addLoadEvent(function() {
-      var img = document.querySelector("img");
-      ok(img.complete, "By onload, image should have loaded");
-      img.src = "image.png?cachebust";
-      ok(!img.complete, "Now that we're loading we should no longer be complete");
-      img.onload = function() {
-        ok(img.complete, "The new thing should have loaded.");
-        SimpleTest.finish();
-      }
-    });
-  </script>
-</pre>
-</body>
-</html>
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -20719,16 +20719,20 @@
         "path": "html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html",
         "url": "/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html"
       },
       {
         "path": "html/semantics/embedded-content/the-img-element/update-media.html",
         "url": "/html/semantics/embedded-content/the-img-element/update-media.html"
       },
       {
+        "path": "html/semantics/embedded-content/the-img-element/update-src-complete.html",
+        "url": "/html/semantics/embedded-content/the-img-element/update-src-complete.html"
+      },
+      {
         "path": "html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html",
         "url": "/html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html"
       },
       {
         "path": "html/semantics/embedded-content/the-img-element/update-the-source-set.html",
         "url": "/html/semantics/embedded-content/the-img-element/update-the-source-set.html"
       },
       {
copy from dom/html/test/image.png
copy to testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Changing the img src should retain the 'complete' property</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p id="display"><img src="image.png"></p>
+<script>
+    function check() {
+        var img = document.querySelector("img");
+        assert_true(img.complete, "By onload, image should have loaded");
+        img.src = `image.png?${Math.random()}`;
+        assert_false(img.complete, "Now that we're loading we should no longer be complete");
+        img.onload = function () {
+            assert_true(img.complete, "The new thing should have loaded.");
+            done();
+        }
+    }
+
+    onload = function () {
+        check();
+    };
+
+</script>