Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / MediaStream-clone.html
blob5a873c2a6b879fb3e5acadbf9ecb300a6a0f1a34
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test cloning mediastreams and their tracks.");
10 var stream;
11 var stream2;
12 var cloned_stream;
13 var track;
14 var cloned_track;
16 function error() {
17 testFailed('Stream generation failed.');
18 finishJSTest();
21 function getUserMedia(dictionary, callback) {
22 try {
23 navigator.webkitGetUserMedia(dictionary, callback, error);
24 } catch (e) {
25 testFailed('webkitGetUserMedia threw exception :' + e);
26 finishJSTest();
30 function gotStream2(s) {
31 stream2 = s;
32 track = stream2.getAudioTracks()[0];
33 cloned_track = track.clone();
34 shouldNotBe('track', 'cloned_track');
35 shouldNotBe('track.id', 'cloned_track.id');
36 stream.addTrack(cloned_track);
37 shouldBe('stream.getAudioTracks().length', '2');
38 finishJSTest();
41 function gotStream(s) {
42 stream = s;
43 shouldBe('stream.getAudioTracks().length', '1');
44 shouldBe('stream.getVideoTracks().length', '1');
46 cloned_stream = stream.clone();
47 shouldNotBe('stream.id', 'cloned_stream.id');
48 shouldBe('cloned_stream.getAudioTracks().length', '1');
49 shouldBe('cloned_stream.getVideoTracks().length', '1');
51 shouldNotBe('stream.getAudioTracks()[0]', 'cloned_stream.getAudioTracks()[0]');
52 shouldNotBe('stream.getVideoTracks()[0]', 'cloned_stream.getVideoTracks()[0]');
53 shouldNotBe('stream.getAudioTracks()[0].id', 'cloned_stream.getAudioTracks()[0].id');
54 shouldNotBe('stream.getVideoTracks()[0].id', 'cloned_stream.getVideoTracks()[0].id');
56 getUserMedia({audio:true, video:true}, gotStream2);
59 getUserMedia({audio:true, video:true}, gotStream);
61 window.jsTestIsAsync = true;
62 window.successfullyParsed = true;
63 </script>
64 </body>
65 </html>