Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html

Issue 2060353005: Convert video-autoplay*, video-black* and video-buffered* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2ae28aad2c62e9e70e238186a145c747d7b1e028 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,20 @@
-<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();
- }
+ var 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>

Powered by Google App Engine
This is Rietveld 408576698