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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-dtmf.html

Issue 2097563002: Split the mediastream module in Blink into mediastream and peerconnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DEPS file Created 4 years, 5 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
(Empty)
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.");
9
10 var pc = null;
11 var stream = null;
12 var dtmfsender = null;
13
14 function error() {
15 testFailed('Error callback called.');
16 finishJSTest();
17 }
18
19 var firstCall = true;
20
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();
30 }
31 }
32
33 function pc_onicechange() {
34 if (pc.iceConnectionState === "completed") {
35 testPassed("pc is connected");
36 track = stream.getAudioTracks()[0];
37
38 shouldThrow('dtmfsender = pc.createDTMFSender(null);');
39 shouldThrow('dtmfsender = pc.createDTMFSender(track);');
40 pc.addStream(stream);
41 shouldNotThrow('dtmfsender = pc.createDTMFSender(track);');
42 shouldBeTrue('dtmfsender.canInsertDTMF');
43
44 dtmfsender.ontonechange = ontonechange;
45 dtmfsender.insertDTMF("1");
46 shouldBeEqualToString('dtmfsender.toneBuffer', "1");
47 }
48 }
49
50 function gotStream(s) {
51 stream = s;
52 testPassed('Stream generated.');
53 shouldBe('stream.getAudioTracks().length', '1');
54 shouldBe('stream.getVideoTracks().length', '0');
55
56 pc = new webkitRTCPeerConnection(null, null);
57 pc.oniceconnectionstatechange = pc_onicechange;
58 }
59
60 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream, error);");
61
62 window.jsTestIsAsync = true;
63 window.successfullyParsed = true;
64 </script>
65 </body>
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698