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

Unified Diff: third_party/WebKit/LayoutTests/media/video-move-to-new-document.html

Issue 1481913002: Remove userCancelledLoad and refactor the code at the call sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case Created 5 years 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-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..3a37e944fa292a8a2f4c5f0c7629b351e37987d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
philipj_slow 2015/12/02 14:02:14 You can omit <html>, <head> and such: https://www.
Srirama 2015/12/02 14:39:18 Done.
+ <head>
+ <title>GC with a pending event in an inactive document</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="media-file.js"></script>
+ <script>
+ function start() {
philipj_slow 2015/12/02 14:02:14 You don't need a start(), just put the script afte
Srirama 2015/12/02 14:39:18 Done.
+ async_test(function(t) {
+ var iframeDocument = document.getElementById('iframe1').contentDocument.document;
+ var video = document.getElementById('iframe1').contentDocument.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_NOTHING);
philipj_slow 2015/12/02 14:02:14 Actually s/HAVE_NOTHING/HAVE_METADATA/ since we ju
Srirama 2015/12/02 14:39:18 Done.
+ // Move the video element to main document
+ // from iframe and verify that it loads properly
+ document.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>
+ </head>
+ <body onload='start()'>
+ <iframe id="iframe1" srcdoc="<html><body><video controls></video></body></html>"></iframe>
Srirama 2015/12/02 13:30:52 Couldn't find a better way than using srcdoc. Keep
philipj_slow 2015/12/02 14:02:14 What you can do is to have an empty video and an e
Srirama 2015/12/02 14:39:18 Done.
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698