Chromium Code Reviews| 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..5bf10bf5e003dc5d6500b1713bfa24995a56d29b 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,24 @@ |
| <!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 skipOnFirstEmptyLoad = 0; |
| + var iframe = document.querySelector("iframe"); |
| - function frameLoaded() |
| - { |
| - if (++skipOnFirstEmptyLoad == 1) |
| - return; |
| + iframe.onload = t.step_func_done(function() { |
|
fs
2016/06/24 15:43:32
Because we're skipping/ignoring the first event, s
Srirama
2016/06/25 14:39:25
Done. Now the event is fired only once as we set o
|
| + if (++skipOnFirstEmptyLoad == 1) |
| + return; |
| - standaloneMediaDocument = document.getElementById("videoframe").contentDocument; |
| - metaElement = standaloneMediaDocument.querySelector("meta"); |
| + var metaElement = iframe.contentDocument.querySelector("meta"); |
| - testExpected("metaElement.name", "viewport"); |
| - testExpected("metaElement.content", "width=device-width"); |
| + assert_equals(metaElement.name, "viewport"); |
| + assert_equals(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> |