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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html

Issue 1881733004: MSE, MS, and any blob URL: Ignore preload 'none' on resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address remainder of comments to date. Pending potential PR of MediaStream test to wpt [2] Created 4 years, 7 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 <script src="mediasource-util.js"></script>
7 <link rel="stylesheet" href="/w3c/resources/testharness.css">
8 </head>
9 <body>
10 <script>
11 function attachWithPreloadTest(preload)
12 {
13 async_test(function(test)
14 {
15 var video = document.createElement('video');
16 var mediaSource = new MediaSource();
17 var mediaSourceURL = URL.createObjectURL(mediaSource);
18
19 video.preload = preload;
20 document.body.appendChild(video);
21 test.add_cleanup(function() {
22 document.body.removeChild(video);
23 URL.revokeObjectURL(mediaSourceURL);
24 });
25
26 var listener = test.step_func(function(event) { test.done(); });
27 mediaSource.addEventListener("sourceopen", listener);
28 video.src = mediaSourceURL;
29 }, "sourceopen occurs with element preload=" + preload);
30 }
31
32 attachWithPreloadTest('auto');
33 attachWithPreloadTest('metadata');
34 attachWithPreloadTest('none');
35
36 function errorWithPreloadTest(preload, bogusURLStyle)
37 {
38 var testURLdescription;
39 var mediaSource = new MediaSource();
40 var bogusURL;
41
42 if (bogusURLStyle == 'revoked') {
43 testURLdescription = "revoked MediaSource object URL";
44 bogusURL = URL.createObjectURL(mediaSource);
45 URL.revokeObjectURL(bogusURL);
46 } else if (bogusURLStyle == 'corrupted') {
47 testURLdescription = 'corrupted MediaSource object URL';
48 bogusURL = URL.createObjectURL(mediaSource);
49 bogusURL += '0';
50 } else {
51 testURLdescription = bogusURL = bogusURLStyle;
52 }
53
54 async_test(function(test)
55 {
56 var video = document.createElement('video');
57
58 video.preload = preload;
59 document.body.appendChild(video);
60 test.add_cleanup(function() { document.body.removeChild(vide o); });
61
62 var listener = test.step_func(function(event) { test.fail(); });
63 mediaSource.addEventListener("sourceopen", listener);
64
65 video.onerror = test.step_func(function(event) { test.done() ; });
66 video.src = bogusURL;
67 }, "error occurs with bogus blob URL (" + testURLdescription + " ) and element preload=" + preload);
68 }
69
70 errorWithPreloadTest('auto', 'revoked');
71 errorWithPreloadTest('metadata', 'revoked');
72 errorWithPreloadTest('none', 'revoked');
73
74 errorWithPreloadTest('auto', 'blob:a');
wolenetz 2016/04/25 20:41:05 Ugh. It looks like I need to s/'/" a bit more here
75 errorWithPreloadTest('metadata', 'blob:a');
76 errorWithPreloadTest('none', 'blob:a');
77
78 errorWithPreloadTest('auto', 'corrupted');
79 errorWithPreloadTest('metadata', 'corrupted');
80 errorWithPreloadTest('none', 'corrupted');
81 </script>
82 </body>
83 </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