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-ice.html

Issue 2007923003: Use Init dictionaries in RTCPeerConnection legacy methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <!-- TODO(guidou): Convert test to testharness.js. crbug.com/614963 -->
5 </head> 6 </head>
6 <body> 7 <body>
7 <script> 8 <script>
8 description("Tests the RTCPeerConnection Ice functionality."); 9 description("Tests the RTCPeerConnection Ice functionality.");
9 10
10 var pc = null; 11 var pc = null;
11 var iceCandidate = null; 12 var iceCandidate = null;
12 13
13 function onIceChange2() 14 function onIceChange2()
14 { 15 {
15 if (pc.iceConnectionState === "closed") { 16 if (pc.iceConnectionState === "closed") {
16 testPassed("iceConnectionState is closed."); 17 testPassed("iceConnectionState is closed.");
17 finishJSTest(); 18 finishJSTest();
18 } 19 }
19 } 20 }
20 21
21 function addIceCandidateSuccess() 22 function addIceCandidateSuccess1()
22 { 23 {
23 testPassed("addIceCandidateSuccess was called."); 24 testPassed("addIceCandidateSuccess1 was called.");
25 shouldNotThrow('pc.addIceCandidate({candidate: "candidate", sdpMid: 0}, addI ceCandidateSuccess2, unexpectedCallback);');
26 }
27
28 function addIceCandidateSuccess2()
29 {
30 testPassed("addIceCandidateSuccess2 was called.");
31 shouldNotThrow('pc.addIceCandidate({candidate: "candidate", sdpMLineIndex: 0 }, addIceCandidateSuccess3, unexpectedCallback);');
32 }
33
34 function addIceCandidateSuccess3()
35 {
36 testPassed("addIceCandidateSuccess3 was called.");
37 shouldNotThrow('pc.addIceCandidate({candidate: "candidate", sdpMid: 0, sdpML ineIndex: 0}, addIceCandidateSuccess4, unexpectedCallback);');
38 }
39
40 function addIceCandidateSuccess4()
41 {
42 testPassed("addIceCandidateSuccess4 was called.");
24 pc.oniceconnectionstatechange = onIceChange2; 43 pc.oniceconnectionstatechange = onIceChange2;
25 pc.close(); 44 pc.close();
26 } 45 }
27 46
28 function unexpectedCallback() 47 function unexpectedCallback()
29 { 48 {
30 testFailed("unexpectedCallback was called."); 49 testFailed("unexpectedCallback was called.");
31 finishJSTest(); 50 finishJSTest();
32 } 51 }
33 52
34 function expectedTypeError(error) 53 function expectedTypeError(error)
35 { 54 {
36 window.error = error; 55 window.error = error;
37 shouldBe('error.name', '"TypeError"'); 56 shouldBe('error.name', '"TypeError"');
38 testPassed("expectedTypeError was called."); 57 testPassed("expectedTypeError was called.");
39 } 58 }
40 59
41 function onIceChange1() 60 function onIceChange1()
42 { 61 {
43 if (pc.iceConnectionState === "completed") { 62 if (pc.iceConnectionState === "completed") {
44 testPassed("iceConnectionState is completed"); 63 testPassed("iceConnectionState is completed");
45 iceCandidate = new RTCIceCandidate({candidate:"nano nano"}); 64 iceCandidate = new RTCIceCandidate({candidate:"nano nano"});
46 shouldNotThrow('pc.addIceCandidate(null, addIceCandidateSuccess, unexpec tedCallback).catch(expectedTypeError);'); 65 shouldNotThrow('pc.addIceCandidate(null, unexpectedCallback, unexpectedC allback).catch(expectedTypeError);');
66 shouldNotThrow('pc.addIceCandidate({candidate: "candidate"}, unexpectedC allback, unexpectedCallback).catch(expectedTypeError);');
47 shouldNotThrow('pc.addIceCandidate(iceCandidate, null, unexpectedCallbac k).catch(expectedTypeError);'); 67 shouldNotThrow('pc.addIceCandidate(iceCandidate, null, unexpectedCallbac k).catch(expectedTypeError);');
48 shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, null).catch(expectedTypeError);'); 68 shouldNotThrow('pc.addIceCandidate(iceCandidate, unexpectedCallback, nul l).catch(expectedTypeError);');
49 shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, unexpectedCallback);'); 69 shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess1 , unexpectedCallback);');
50 } 70 }
51 } 71 }
52 72
53 function testExecutionOrderClosedConnection() 73 function testExecutionOrderClosedConnection()
54 { 74 {
55 var localPeerConnection = new webkitRTCPeerConnection(null, null); 75 var localPeerConnection = new webkitRTCPeerConnection(null, null);
56 localPeerConnection.close(); 76 localPeerConnection.close();
57 var counter = 0; 77 var counter = 0;
58 window.events = []; 78 window.events = [];
59 Promise.resolve().then(_ => events[counter++] = 1); 79 Promise.resolve().then(_ => events[counter++] = 1);
(...skipping 12 matching lines...) Expand all
72 92
73 shouldNotThrow('testExecutionOrderClosedConnection()'); 93 shouldNotThrow('testExecutionOrderClosedConnection()');
74 shouldNotThrow('pc = new webkitRTCPeerConnection(null, null);'); 94 shouldNotThrow('pc = new webkitRTCPeerConnection(null, null);');
75 pc.oniceconnectionstatechange = onIceChange1; 95 pc.oniceconnectionstatechange = onIceChange1;
76 96
77 window.jsTestIsAsync = true; 97 window.jsTestIsAsync = true;
78 window.successfullyParsed = true; 98 window.successfullyParsed = true;
79 </script> 99 </script>
80 </body> 100 </body>
81 </html> 101 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698