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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html

Issue 2021573002: MSE: Reset delaying-the-load-event-flag on attachment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed foolip@'s nits 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 async_test(function(test)
10 {
11 var receivedLoadEvent = false;
12
13 window.addEventListener("load", test.step_func(function() {
14 assert_false(receivedLoadEvent, "window should not receive m ultiple load events");
15 receivedLoadEvent = true;
16 }));
17
18 assert_equals(document.readyState, "loading", "document should n ot be complete yet");
19 var video = document.createElement("video");
20 var mediaSource = new MediaSource();
21
22 // |video| should stop delaying the load event long before eithe r a
23 // "progress", "stalled" or "suspend" event are enqueued.
24 video.addEventListener("suspend", test.unreached_func("unexpecte d 'suspend' event"));
25 video.addEventListener("stalled", test.unreached_func("unexpecte d 'stalled' event"));
26 video.addEventListener("progress", test.unreached_func("unexpect ed 'progress' event"));
27
28 // No error is expected.
29 video.addEventListener("error", test.unreached_func("unexpected 'error' event"));
30
31 mediaSource.addEventListener("sourceopen", test.step_func(functi on() {
32 assert_true(receivedLoadEvent, "load event should have been received first");
33 assert_equals(video.networkState, video.NETWORK_LOADING);
34 assert_equals(video.readyState, video.HAVE_NOTHING);
35 assert_equals(document.readyState, "complete", "document sho uld be complete");
36 test.done();
37 }));
38
39 var mediaSourceURL = URL.createObjectURL(mediaSource);
40 video.src = mediaSourceURL;
41 test.add_cleanup(function() { URL.revokeObjectURL(mediaSourceURL ); });
42 }, "MediaSource attachment should immediately stop delaying the load event");
43 </script>
44 </body>
45 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698