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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/video-throttled-load-metadata.html

Issue 2180243002: Convert video-[in, throttled, useragent]* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>This test case simulates a slow network, and starts a web worker thread t o write a log message when retrieving media metadata to see if the webkit thread is blocked by media retrieving thread.</title>
3 <title>throttled loading metadata</title> 3 <script src="../resources/testharness.js"></script>
4 <script src="../../media-resources/media-file.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 5 <video></video>
6 (Please avoid writing new tests using video-test.js) --> 6 <script>
7 <script src="../../media-resources/video-test.js"></script> 7 // This test case is for https://bugs.webkit.org/show_bug.cgi?id=80978.
8 <script> 8 async_test(function(t) {
9 function loadedmetadata(e) 9 var workerExecuted = false;
10 { 10 var video = document.querySelector("video");
11 logResult(true, "loaded metadata of media file");
12 endTest();
13 }
14 11
15 function error(e) 12 video.onloadedmetadata = t.step_func_done(function() {
16 { 13 assert_true(workerExecuted);
17 logResult(false, "failed to load media file"); 14 });
18 endTest();
19 }
20 15
21 function start() 16 video.onerror = t.unreached_func();
22 { 17 assert_equals(video.error, null);
23 findMediaElement();
24 18
25 waitForEvent('loadedmetadata', loadedmetadata); 19 var worker = new Worker("video-throttled-load-metadata-worker.js");
26 waitForEvent("error", error); 20 worker.onmessage = t.step_func(function() {
27 testExpected("video.error", null); 21 workerExecuted = true;
22 });
28 23
29 var worker = new Worker("video-throttled-load-metadata-worker.js"); 24 // Use a .webm to ensure metadata is near the beginning of the file.
30 worker.onmessage = function (event) { 25 var mediaFile = "resources/media-source/webm/test.webm";
31 logResult(true, event.data); 26 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?" +
32 } 27 "nph=1&name=" + mediaFile + "&throttle=40&type=video/webm" +
33 28 "avoidCache=" + Math.random();
34 // Use a .webm to ensure metadata is near the beginning of the file. 29 });
35 var mediaFile = "resources/media-source/webm/test.webm"; 30 </script>
36 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?" +
37 "nph=1&name=" + mediaFile + "&throttle=40&type=video/webm" +
38 "avoidCache=" + Math.random();
39
40 video.load();
41 }
42 </script>
43 </head>
44 <body onload="start()">
45 <video id="video"></video>
46 <p>
47 This test case simulates a slow network, and starts a web worker thread to write a log message
48 when retrieving media metadata to see if the webkit thread is blocked by media r etrieving thread.<br>
49 This test case is for <a href="https://bugs.webkit.org/show_bug.cgi?id=80978">ht tps://bugs.webkit.org/show_bug.cgi?id=80978</a>
50 </p>
51 </body>
52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698