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

Side by Side Diff: webrtc/tools/rtcbot/test/simple_offer_answer.js

Issue 2965593002: Move webrtc/{tools => rtc_tools} (Closed)
Patch Set: Adding back root changes Created 3 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 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 //
9 // Test that offer/answer between 2 peers completes successfully.
10 //
11 // Note: This test does not performs ice candidate exchange and
12 // does not verifies that media can flow between the peers.
13 function testOfferAnswer(test, bot1, bot2) {
14 test.wait( [ bot1.createPeerConnection.bind(bot1, null),
15 bot2.createPeerConnection.bind(bot2, null) ],
16 run);
17
18 function run(pc1, pc2) {
19 test.log("Establishing call.");
20 pc1.createOffer(gotOffer);
21
22 function gotOffer(offer) {
23 test.log("Got offer");
24 expectedCall();
25 pc1.setLocalDescription(offer, expectedCall, test.fail);
26 pc2.setRemoteDescription(offer, expectedCall, test.fail);
27 pc2.createAnswer(gotAnswer, test.fail);
28 }
29
30 function gotAnswer(answer) {
31 test.log("Got answer");
32 expectedCall();
33 pc2.setLocalDescription(answer, expectedCall, test.fail);
34 pc1.setRemoteDescription(answer, expectedCall, test.fail);
35 }
36
37 // TODO(andresp): Implement utilities in test to write expectations
38 // that certain methods must be called.
39 var expectedCalls = 0;
40 function expectedCall() {
41 if (++expectedCalls == 6)
42 test.done();
43 }
44 }
45 }
46
47 registerBotTest('testOfferAnswer/chrome-chrome',
48 testOfferAnswer, ['chrome', 'chrome']);
OLDNEW
« no previous file with comments | « webrtc/tools/rtcbot/test/ping_pong.js ('k') | webrtc/tools/rtcbot/test/three_bots_video_conference.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698