OLD | NEW |
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 <script> | 7 <script> |
8 description("Tests RTCDTMFSender."); | 8 description("Tests RTCDTMFSender."); |
9 | 9 |
10 var pc = null; | 10 var pc = null; |
(...skipping 17 matching lines...) Expand all Loading... |
28 shouldBeEqualToString('event.tone', ""); | 28 shouldBeEqualToString('event.tone', ""); |
29 finishJSTest(); | 29 finishJSTest(); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 function pc_onicechange() { | 33 function pc_onicechange() { |
34 if (pc.iceConnectionState === "completed") { | 34 if (pc.iceConnectionState === "completed") { |
35 testPassed("pc is connected"); | 35 testPassed("pc is connected"); |
36 track = stream.getAudioTracks()[0]; | 36 track = stream.getAudioTracks()[0]; |
37 | 37 |
| 38 shouldThrow('dtmfsender = pc.createDTMFSender(null);'); |
38 shouldThrow('dtmfsender = pc.createDTMFSender(track);'); | 39 shouldThrow('dtmfsender = pc.createDTMFSender(track);'); |
39 pc.addStream(stream); | 40 pc.addStream(stream); |
40 shouldNotThrow('dtmfsender = pc.createDTMFSender(track);'); | 41 shouldNotThrow('dtmfsender = pc.createDTMFSender(track);'); |
41 shouldBeTrue('dtmfsender.canInsertDTMF'); | 42 shouldBeTrue('dtmfsender.canInsertDTMF'); |
42 | 43 |
43 dtmfsender.ontonechange = ontonechange; | 44 dtmfsender.ontonechange = ontonechange; |
44 dtmfsender.insertDTMF("1"); | 45 dtmfsender.insertDTMF("1"); |
45 shouldBeEqualToString('dtmfsender.toneBuffer', "1"); | 46 shouldBeEqualToString('dtmfsender.toneBuffer', "1"); |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 function gotStream(s) { | 50 function gotStream(s) { |
50 stream = s; | 51 stream = s; |
51 testPassed('Stream generated.'); | 52 testPassed('Stream generated.'); |
52 shouldBe('stream.getAudioTracks().length', '1'); | 53 shouldBe('stream.getAudioTracks().length', '1'); |
53 shouldBe('stream.getVideoTracks().length', '0'); | 54 shouldBe('stream.getVideoTracks().length', '0'); |
54 | 55 |
55 pc = new webkitRTCPeerConnection(null, null); | 56 pc = new webkitRTCPeerConnection(null, null); |
56 pc.oniceconnectionstatechange = pc_onicechange; | 57 pc.oniceconnectionstatechange = pc_onicechange; |
57 } | 58 } |
58 | 59 |
59 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream, error);"); | 60 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream, error);"); |
60 | 61 |
61 window.jsTestIsAsync = true; | 62 window.jsTestIsAsync = true; |
62 window.successfullyParsed = true; | 63 window.successfullyParsed = true; |
63 </script> | 64 </script> |
64 </body> | 65 </body> |
65 </html> | 66 </html> |
OLD | NEW |