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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..ef851018f5638b69ec19653b5ec30c625cf2e6b7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="/w3c/resources/testharness.js"></script>
+ <script src="/w3c/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ async_test(function(test)
+ {
+ var receivedLoadEvent = false;
+
+ window.addEventListener("load", test.step_func(function() {
+ assert_false(receivedLoadEvent, "window should not receive multiple load events");
+ receivedLoadEvent = true;
+ }));
+
+ assert_equals(document.readyState, "loading", "document should not be complete yet");
+ var video = document.createElement("video");
+ var mediaSource = new MediaSource();
+
+ // |video| should stop delaying the load event long before either a
+ // "progress", "stalled" or "suspend" event are enqueued.
+ video.addEventListener("suspend", test.unreached_func("unexpected 'suspend' event"));
+ video.addEventListener("stalled", test.unreached_func("unexpected 'stalled' event"));
+ video.addEventListener("progress", test.unreached_func("unexpected 'progress' event"));
+
+ // No error is expected.
+ video.addEventListener("error", test.unreached_func("unexpected 'error' event"));
+
+ mediaSource.addEventListener("sourceopen", test.step_func(function() {
+ assert_true(receivedLoadEvent, "load event should have been received first");
+ assert_equals(video.networkState, video.NETWORK_LOADING);
+ assert_equals(video.readyState, video.HAVE_NOTHING);
+ assert_equals(document.readyState, "complete", "document should be complete");
+ test.done();
+ }));
+
+ var mediaSourceURL = URL.createObjectURL(mediaSource);
+ video.src = mediaSourceURL;
+ test.add_cleanup(function() { URL.revokeObjectURL(mediaSourceURL); });
+ }, "MediaSource attachment should immediately stop delaying the load event");
+ </script>
+ </body>
+</html>
« 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