Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html |
| index aa2e5fb9e770989a8f413465fffd88a0ac58c46b..6724e9766c654c462095a5d33fe6dc3607b37f01 100644 |
| --- a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html |
| +++ b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html |
| @@ -1,30 +1,21 @@ |
| -<html> |
| - <head> |
| - <script src="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="video-test.js"></script> |
| - <script> |
| - function iframeLoad() { |
| - var iframe = document.querySelector("iframe"); |
| - var iframeBody = iframe.contentDocument.querySelector("body"); |
| +<!DOCTYPE html> |
| +<title>Test that video media documents have a black background.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="media-file.js"></script> |
| +<iframe></iframe> |
| +<script> |
| +async_test(function(t) { |
| + var iframe = document.querySelector("iframe"); |
| + iframe.onload = t.step_func_done(function() { |
| + var iframeDocument = iframe.contentDocument; |
| + var iframeBody = iframeDocument.querySelector("body"); |
| - // Required to be global for testExpected() to work properly. |
| - iframeBodyStyle = iframe.contentDocument.defaultView.getComputedStyle(iframeBody, null); |
| - testExpected("iframeBodyStyle.backgroundColor", "rgb(0, 0, 0)"); |
| - endTest(); |
| - } |
| + // Required to be global for assert_equals() to work properly. |
|
fs
2016/06/14 15:41:37
Nit: Don't think this requirement is still needed.
Srirama
2016/06/14 16:04:13
Done. Not required to be global.
|
| + iframeBodyStyle = iframeDocument.defaultView.getComputedStyle(iframeBody); |
| + assert_equals(iframeBodyStyle.backgroundColor, "rgb(0, 0, 0)"); |
| + }); |
| - function load() { |
| - var iframe = document.querySelector("iframe"); |
| - iframe.onload = iframeLoad; |
| - iframe.src = findMediaFile("video", "content/counting"); |
| - } |
| - </script> |
| - </head> |
| - |
| - <body onload="load()"> |
| - <p>Test that video media documents have a black background.</p> |
| - <iframe style="width: 200px; height: 200px;"></iframe> |
| - </body> |
| -</html> |
| + iframe.src = findMediaFile("video", "content/counting"); |
| +}); |
| +</script> |