OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachus
etts Institute of Technology, ERCIM, Keio University, Beihang). --> | 2 <!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachus
etts Institute of Technology, ERCIM, Keio University, Beihang). --> |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <title>Test that the HTMLMediaElement preload 'none' attribute value is
ignored for MediaStream used as srcObject and MediaStream object URLs used as sr
c.</title>> | 5 <title>Test that the HTMLMediaElement preload 'none' attribute value is
ignored for MediaStream used as srcObject and MediaStream object URLs used as sr
c.</title>> |
6 <link rel="author" title="Matthew Wolenetz" href="mailto:wolenetz@chromi
um.org"/> | 6 <link rel="author" title="Matthew Wolenetz" href="mailto:wolenetz@chromi
um.org"/> |
7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
9 <script src="/common/vendor-prefix.js" data-prefixed-objects='[{"ancesto
rs":["navigator"], "name":"getUserMedia"}, {"ancestors":["window"], "name":"Medi
aStream"}]'></script> | 9 <script src="/common/vendor-prefix.js" data-prefixed-objects='[{"ancesto
rs":["navigator"], "name":"getUserMedia"}, {"ancestors":["window"], "name":"Medi
aStream"}]'></script> |
10 </head> | 10 </head> |
11 <body> | 11 <body> |
12 <p class="instructions">When prompted, accept to share your audio and vi
deo streams.</p> | 12 <p class="instructions">When prompted, accept to share your audio and vi
deo streams.</p> |
13 <h1 class="instructions">Description</h1> | 13 <h1 class="instructions">Description</h1> |
14 <p class="instructions">This test checks that the HTMLMediaElement prelo
ad 'none' attribute value is ignored for MediaStream used as srcObject and Media
Stream object URLs used as src.</p> | 14 <p class="instructions">This test checks that the HTMLMediaElement prelo
ad 'none' attribute value is ignored for MediaStream used as srcObject and Media
Stream object URLs used as src.</p> |
15 | 15 |
16 <audio preload="none"></audio> | 16 <audio preload="none"></audio> |
17 <video preload="none"></video> | 17 <video preload="none"></video> |
18 | 18 |
19 <script> | 19 <script> |
20 function testPreloadNone(t, mediaElement, setSourceStreamFunc) | 20 function testPreloadNone(t, mediaElement, setSourceStreamFunc) |
21 { | 21 { |
22 // The optional deferred load steps (for preload none) for Media
Stream resources should be skipped. | 22 // The optional deferred load steps (for preload none) for Media
Stream resources should be skipped. |
23 mediaElement.addEventListener("suspend", t.unreached_func("'susp
end' should not be fired.")); | 23 mediaElement.addEventListener("suspend", t.unreached_func("'susp
end' should not be fired.")); |
| 24 mediaElement.addEventListener("error", t.step_func(function() { |
| 25 assert_unreached("'error' should not be fired, code=" + mediaE
lement.error.code); |
| 26 })); |
24 | 27 |
25 mediaElement.addEventListener("loadeddata", t.step_func(function
() | 28 mediaElement.addEventListener("loadeddata", t.step_func(function
() |
26 { | 29 { |
27 assert_equals(mediaElement.networkState, mediaElement.NETWOR
K_LOADING); | 30 assert_equals(mediaElement.networkState, mediaElement.NETWOR
K_LOADING); |
28 t.done(); | 31 t.done(); |
29 })); | 32 })); |
30 | 33 |
31 setSourceStreamFunc(); | 34 setSourceStreamFunc(); |
32 assert_equals(mediaElement.networkState, mediaElement.NETWORK_NO
_SOURCE); // Resource selection is active. | 35 assert_equals(mediaElement.networkState, mediaElement.NETWORK_NO
_SOURCE); // Resource selection is active. |
33 } | 36 } |
(...skipping 15 matching lines...) Expand all Loading... |
49 { | 52 { |
50 var vid = document.querySelector("video"); | 53 var vid = document.querySelector("video"); |
51 navigator.getUserMedia({video:true}, t.step_func(function(stream
) | 54 navigator.getUserMedia({video:true}, t.step_func(function(stream
) |
52 { | 55 { |
53 testPreloadNone(t, vid, t.step_func(function() { vid.srcObje
ct = stream; })); | 56 testPreloadNone(t, vid, t.step_func(function() { vid.srcObje
ct = stream; })); |
54 }), t.unreached_func("getUserMedia error callback was invoked.")
); | 57 }), t.unreached_func("getUserMedia error callback was invoked.")
); |
55 }, "Test that preload 'none' is ignored for MediaStream used as srcO
bject"); | 58 }, "Test that preload 'none' is ignored for MediaStream used as srcO
bject"); |
56 </script> | 59 </script> |
57 </body> | 60 </body> |
58 </html> | 61 </html> |
OLD | NEW |