Bug 1316629 - migrate dom/html/test/test_img_complete.html to web-platform-test. r=jgraham

MozReview-Commit-ID: 7tyxMzVQ1g2

--HG--
rename : dom/html/test/image.png => testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png
This commit is contained in:
Joel Maher 2016-11-16 09:43:53 -05:00
Родитель 07f0500878
Коммит 15b1c3dd86
5 изменённых файлов: 27 добавлений и 38 удалений

Просмотреть файл

@ -580,7 +580,6 @@ support-files = file_bug871161-1.html file_bug871161-2.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]

Просмотреть файл

@ -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>

Просмотреть файл

@ -20723,6 +20723,10 @@
"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"

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 268 B

Просмотреть файл

@ -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>