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

Unified Diff: third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html

Issue 2094993002: Convert video-volume*, video-width* and viewport* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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/viewport-in-standalone-media-document.html
diff --git a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
index a2fb4e9a16569d241e1a670eb5f2339671462f4c..1f70d538aed3bd594c55029ed70f937d07bb18ae 100644
--- a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
@@ -1,37 +1,19 @@
<!DOCTYPE html>
-<html>
- <head>
- <script src="../media/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/video-test.js"></script>
- <script>
- var metaElement;
- var standaloneMediaDocument;
- var skipOnFirstEmptyLoad = 0;
+<title>This tests that a standalone media document has viewport settings.</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");
- function frameLoaded()
- {
- if (++skipOnFirstEmptyLoad == 1)
- return;
+ iframe.onload = t.step_func_done(function() {
+ var metaElement = iframe.contentDocument.querySelector("meta");
+ assert_equals(metaElement.name, "viewport");
+ assert_equals(metaElement.content, "width=device-width");
+ });
- standaloneMediaDocument = document.getElementById("videoframe").contentDocument;
- metaElement = standaloneMediaDocument.querySelector("meta");
-
- testExpected("metaElement.name", "viewport");
- testExpected("metaElement.content", "width=device-width");
-
- endTest();
- }
- </script>
- </head>
- <body>
- <p>
- This tests that a standalone media document has viewport settings.
- </p>
- <iframe id="videoframe" onload="frameLoaded()"></iframe>
- <script>
- document.getElementById("videoframe").src = findMediaFile("video", "content/test");
- </script>
- </body>
-</html>
+ iframe.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698