X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fwebrtc%2Ftools%2Frtcbot%2Ftest%2Fsimple_offer_answer.js;h=888662a0de03e53e889f4b6c7895630b302a64d6;hb=refs%2Fchanges%2F05%2F32605%2F1;hp=61eb0bafab0616da08fcdbbf0e713dfc8ea5d9f0;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/webrtc/tools/rtcbot/test/simple_offer_answer.js b/src/third_party/webrtc/tools/rtcbot/test/simple_offer_answer.js index 61eb0ba..888662a 100644 --- a/src/third_party/webrtc/tools/rtcbot/test/simple_offer_answer.js +++ b/src/third_party/webrtc/tools/rtcbot/test/simple_offer_answer.js @@ -10,17 +10,12 @@ // // Note: This test does not performs ice candidate exchange and // does not verifies that media can flow between the peers. -function testOfferAnswer(peer1, peer2) { - test.wait([ - createPeerConnection.bind(peer1), - createPeerConnection.bind(peer2) ], - establishCall); +function testOfferAnswer(test, bot1, bot2) { + test.wait( [ bot1.createPeerConnection.bind(bot1, null), + bot2.createPeerConnection.bind(bot2, null) ], + run); - function createPeerConnection(done) { - this.createPeerConnection(done, test.fail); - } - - function establishCall(pc1, pc2) { + function run(pc1, pc2) { test.log("Establishing call."); pc1.createOffer(gotOffer); @@ -38,17 +33,16 @@ function testOfferAnswer(peer1, peer2) { pc2.setLocalDescription(answer, expectedCall, test.fail); pc1.setRemoteDescription(answer, expectedCall, test.fail); } - } -} -// TODO(andresp): Implement utilities in test to write expectations that certain -// methods must be called. -var expectedCalls = 0; -function expectedCall() { - if (++expectedCalls == 6) - test.done(); + // TODO(andresp): Implement utilities in test to write expectations + // that certain methods must be called. + var expectedCalls = 0; + function expectedCall() { + if (++expectedCalls == 6) + test.done(); + } + } } -test.wait( [ test.spawnBot.bind(test, "alice"), - test.spawnBot.bind(test, "bob") ], - testOfferAnswer); +registerBotTest('testOfferAnswer/chrome-chrome', + testOfferAnswer, ['chrome', 'chrome']);