Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-move-to-new-document.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1c3aa209c7bd0008b2f9b268dac4b5dc21c2f22f |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<title>Verify that moving a video element to a new document, still loads it normally</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="media-file.js"></script> |
| +<video></video> |
| +<iframe id="iframe1"></iframe> |
|
philipj_slow
2015/12/04 10:58:38
You can use document.querySelector('iframe') and d
Srirama
2015/12/04 12:11:06
Done.
|
| +<script> |
| + async_test(function(t) { |
| + var video = document.querySelector('video'); |
| + video.src = findMediaFile("video", "content/test"); |
| + video.onloadeddata = this.step_func(function() { |
| + video.onloadeddata = null; |
| + assert_true(video.networkState == video.NETWORK_IDLE || video.networkState == video.NETWORK_LOADING); |
| + assert_greater_than(video.readyState, video.HAVE_METADATA); |
| + // Move the video element to iframe document from |
| + // main document and verify that it loads properly |
| + document.getElementById('iframe1').contentDocument.body.appendChild(video); |
| + assert_equals(video.networkState, video.NETWORK_NO_SOURCE); |
| + assert_equals(video.readyState, video.HAVE_NOTHING); |
| + var actual_events = []; |
| + var expected_events = ['emptied', 'loadstart', 'loadeddata']; |
| + expected_events.forEach(function(type) { |
| + video.addEventListener(type, t.step_func(function() { |
| + actual_events.push(type); |
| + if (type == 'loadeddata') { |
| + assert_array_equals(actual_events, expected_events); |
| + t.done(); |
| + } |
| + })); |
| + }); |
| + }); |
| + }); |
| +</script> |