Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/images/move-image-to-new-document.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/images/move-image-to-new-document.html b/third_party/WebKit/LayoutTests/fast/images/move-image-to-new-document.html |
| index 2ea24e5098fe1eb3b3fd0377619906c253f1927d..3568ef5e4921cae0c4555cdbb7aba48d8469ea56 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/images/move-image-to-new-document.html |
| +++ b/third_party/WebKit/LayoutTests/fast/images/move-image-to-new-document.html |
| @@ -1,9 +1,29 @@ |
| -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| -<html> |
| -<head> |
| -<script src="../../resources/js-test.js"></script> |
| -</head> |
| +<!DOCTYPE html> |
| +<title>Test that when images are moved to a new document, a new load fires.</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <body> |
| -<script src="script-tests/move-image-to-new-document.js"></script> |
| -</body> |
| -</html> |
| +<script type="text/javascript"> |
| +if (window.testRunner) |
| + testRunner.setPluginsEnabled(false); |
| +for (var elementType of [ "img", "input", "object", "embed" ]) { |
| + async_test(function(t) { |
| + var subframe = document.createElement("iframe"); |
| + document.body.appendChild(subframe); |
| + var subdocument = subframe.contentDocument; |
| + var element = document.createElement(elementType); |
|
fs
2016/08/19 08:28:45
Nit: Inconsistent indentation for the four lines a
sivag
2016/08/19 09:10:04
Done.
|
| + if (elementType == "input") |
| + element.type = "image"; |
| + element.data = "resources/test-load.jpg"; |
| + element.src = "resources/test-load.jpg"; |
| + document.body.appendChild(element); |
| + element.onload = t.step_func(function() { |
| + document.body.removeChild(element); |
| + subdocument.body.appendChild(element); |
| + element.onload = t.step_func_done(function() { |
| + subdocument.body.removeChild(element); |
| + }); |
| + }); |
| + }, document.title + ', ' + elementType); |
| +} |
| +</script> |