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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html

Issue 2979893002: media: Allow suspend on HTTP 200 videos (Closed)
Patch Set: layout test fix Created 3 years, 5 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 | « media/blink/webmediaplayer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>GC while networkState is NETWORK_LOADING</title> 2 <title>GC while networkState is NETWORK_LOADING</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="../../media-resources/media-file.js"></script> 5 <script src="../../media-resources/media-file.js"></script>
6 <script> 6 <script>
7 async_test(function(t) 7 async_test(function(t)
8 { 8 {
9 var v = document.createElement("video"); 9 var v = document.createElement("video");
10 v.foo = "bar"; 10 v.foo = "bar";
11 var mediaFile = findMediaFile("video", "../../../media/content/test"); 11 var mediaFile = findMediaFile("video", "../../../media/content/test");
12 var type = mimeTypeForExtension(mediaFile.split(".").pop()); 12 var type = mimeTypeForExtension(mediaFile.split(".").pop());
13 v.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + media File + "&throttle=50&type=" + type; 13 v.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + media File + "&throttle=50&type=" + type;
14 v.onloadeddata = t.step_func(function() 14 v.onloadstart = t.step_func(function()
15 { 15 {
16 assert_equals(v.networkState, v.NETWORK_LOADING); 16 assert_equals(v.networkState, v.NETWORK_LOADING);
17 // The delaying-the-load-event flag is now false. 17 // The delaying-the-load-event flag is now false.
18 // Continue after a timeout since the current event target is the media 18 // Continue after a timeout since the current event target is the media
19 // element, which means that it cannot be garbage collected now. 19 // element, which means that it cannot be garbage collected now.
20 setTimeout(t.step_func(gcAndAwaitProgress), 0); 20 setTimeout(t.step_func(gcAndAwaitProgress), 0);
21 }); 21 });
22 function gcAndAwaitProgress() 22 function gcAndAwaitProgress()
23 { 23 {
24 v.onprogress = t.step_func(function(e) 24 v.onprogress = t.step_func(function(e)
25 { 25 {
26 assert_equals(e.target.foo, "bar"); 26 assert_equals(e.target.foo, "bar");
27 t.done(); 27 t.done();
28 }); 28 });
29 v = null; 29 v = null;
30 gc(); 30 gc();
31 } 31 }
32 }); 32 });
33 </script> 33 </script>
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698