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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/MediaStream-onactive-oninactive.html

Issue 2365883002: Expose the MediaStream interface (Closed)
Patch Set: drop TODO Created 4 years, 2 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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description("Test onactive/oninactive callback."); 10 description("Test onactive/oninactive callback.");
(...skipping 14 matching lines...) Expand all
25 25
26 var stream; 26 var stream;
27 27
28 function streamActive() { 28 function streamActive() {
29 testPassed('streamActive was called.'); 29 testPassed('streamActive was called.');
30 shouldBeTrue('stream.active'); 30 shouldBeTrue('stream.active');
31 finishJSTest(); 31 finishJSTest();
32 } 32 }
33 33
34 function gotStream2(s) { 34 function gotStream2(s) {
35 stream = new webkitMediaStream(); 35 stream = new MediaStream();
36 shouldBeFalse('stream.active'); 36 shouldBeFalse('stream.active');
37 stream.onactive = streamActive; 37 stream.onactive = streamActive;
38 stream.addTrack(s.getAudioTracks()[0]); 38 stream.addTrack(s.getAudioTracks()[0]);
39 } 39 }
40 40
41 function streamInactive() { 41 function streamInactive() {
42 testPassed('streamInactive was called.'); 42 testPassed('streamInactive was called.');
43 shouldBeFalse('stream.active'); 43 shouldBeFalse('stream.active');
44 44
45 getUserMedia({audio:true, video:true}, gotStream2); 45 getUserMedia({audio:true, video:true}, gotStream2);
46 } 46 }
47 47
48 function gotStream(s) { 48 function gotStream(s) {
49 stream = s; 49 stream = s;
50 shouldBeTrue('stream.active'); 50 shouldBeTrue('stream.active');
51 stream.oninactive = streamInactive; 51 stream.oninactive = streamInactive;
52 shouldBe('stream.getAudioTracks().length', '1'); 52 shouldBe('stream.getAudioTracks().length', '1');
53 shouldBe('stream.getVideoTracks().length', '1'); 53 shouldBe('stream.getVideoTracks().length', '1');
54 stream.removeTrack(stream.getAudioTracks()[0]); 54 stream.removeTrack(stream.getAudioTracks()[0]);
55 stream.removeTrack(stream.getVideoTracks()[0]); 55 stream.removeTrack(stream.getVideoTracks()[0]);
56 } 56 }
57 57
58 getUserMedia({audio:true, video:true}, gotStream); 58 getUserMedia({audio:true, video:true}, gotStream);
59 59
60 window.jsTestIsAsync = true; 60 window.jsTestIsAsync = true;
61 window.successfullyParsed = true; 61 window.successfullyParsed = true;
62 </script> 62 </script>
63 </body> 63 </body>
64 </html> 64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698