Index: third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html |
index 123bb229f997a0e8cbbe3b78d95ea5a6c2ff1024..70dd2fa3f8ac100ccd7272e355204132e8e4c90b 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html |
@@ -1,57 +1,45 @@ |
-<html> |
-<head> |
- <title>Cancel loading a video file and access its properties afterwards.</title> |
-</head> |
-<body> |
- Access a video element with resource loading canceled. |
- If this test is successful it will terminate with a blank page. |
- This test should finish without crashing. |
+<!DOCTYPE html> |
+<title>Cancel loading a video file and access its properties afterwards.</title> |
+<script src="../../media-resources/media-file.js"></script> |
+<video></video> |
- <script src=../../media-resources/media-file.js></script> |
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
- <script src=../../media-resources/video-test.js></script> |
- <video controls id="video"></video> |
+<textarea style="display: none;"> |
+<!-- Begin child content --> |
+<!-- The following section contains the content in the document of child window. --> |
+<script> |
+var video = window.opener.video; |
+window.setTimeout(function() { |
+ var d = video.duration; |
+ testRunner.notifyDone(); |
+}, 50); |
+window.opener.blank(); |
+</script> |
+<!-- End child content --> |
+</textarea> |
- <textarea id="child_content" style="display: none;"> |
- <!-- Begin child content --> |
- <!-- The following section contains the content in the document of child window. --> |
- <script> |
- var video = window.opener.video; |
- window.setTimeout(function () { |
- var d = video.duration; |
- if (window.testRunner) |
- testRunner.notifyDone(); |
- }, 50); |
- window.opener.blank(); |
- </script> |
- <!-- End child content --> |
- </textarea> |
+<script> |
+// Access a video element with resource loading canceled. |
+// If this test is successful it will terminate with a blank page. |
+// This test should finish without crashing. |
+testRunner.setCanOpenWindows(); |
+testRunner.dumpAsText(); |
- <script> |
- if (window.testRunner) { |
- testRunner.setCanOpenWindows(); |
- } |
+var video = document.querySelector("video"); |
- var video = document.getElementById("video"); |
- var file = findMediaFile("video", "../resources/test"); |
+// Opens a window and writes the child content into the document. |
+video.onloadedmetadata = function() { |
+ var win = window.open("", "child"); |
+ var doc = win.document; |
+ doc.open(); |
+ doc.write(document.querySelector("textarea").value); |
+ doc.close(); |
+}; |
- // Opens a window and writes the child content into the document. |
- video.addEventListener("loadedmetadata", function main() |
- { |
- var win = window.open("", "child"); |
- var doc = win.document; |
- doc.open(); |
- doc.write(document.getElementById("child_content").value); |
- doc.close(); |
- }); |
- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file; |
+var file = findMediaFile("video", "../resources/test"); |
+video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file; |
- // Change URL of the current page to a blank page. |
- function blank() |
- { |
- location.href = "about:blank"; |
- } |
- </script> |
-</body> |
-</html> |
+// Change URL of the current page to a blank page. |
+function blank() { |
+ location.href = "about:blank"; |
+} |
+</script> |