Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / RTCPeerConnection-dtmf.html
blobedfec69adb9ae5ccd76003372fdf5373aeeeda2d
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("Tests RTCDTMFSender.");
10 var pc = null;
11 var stream = null;
12 var dtmfsender = null;
14 function error() {
15 testFailed('Error callback called.');
16 finishJSTest();
19 var firstCall = true;
21 function ontonechange(e) {
22 testPassed("ontonechange was called.");
23 event = e;
24 if (firstCall) {
25 shouldBeEqualToString('event.tone', "1");
26 firstCall = false;
27 } else {
28 shouldBeEqualToString('event.tone', "");
29 finishJSTest();
33 function pc_onicechange() {
34 if (pc.iceConnectionState === "completed") {
35 testPassed("pc is connected");
36 track = stream.getAudioTracks()[0];
38 shouldThrow('dtmfsender = pc.createDTMFSender(track);');
39 pc.addStream(stream);
40 shouldNotThrow('dtmfsender = pc.createDTMFSender(track);');
41 shouldBeTrue('dtmfsender.canInsertDTMF');
43 dtmfsender.ontonechange = ontonechange;
44 dtmfsender.insertDTMF("1");
45 shouldBeEqualToString('dtmfsender.toneBuffer', "1");
49 function gotStream(s) {
50 stream = s;
51 testPassed('Stream generated.');
52 shouldBe('stream.getAudioTracks().length', '1');
53 shouldBe('stream.getVideoTracks().length', '0');
55 pc = new webkitRTCPeerConnection(null, null);
56 pc.oniceconnectionstatechange = pc_onicechange;
59 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream, error);");
61 window.jsTestIsAsync = true;
62 window.successfullyParsed = true;
63 </script>
64 </body>
65 </html>