- Adding AndroidDeviceManager to botManager.js to help in selecting devices, in case running test on Android devices.

- Select BotType using nodeJs terminal command.

- ping_pong.js test added.

R=andresp@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19159004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7099 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
houssainy@google.com
2014-09-08 10:36:11 +00:00
parent 142bb9d870
commit c77e4d6aef
4 changed files with 99 additions and 8 deletions

View File

@ -16,11 +16,12 @@ var fs = require('fs');
var vm = require('vm');
var BotManager = require('./botmanager.js');
function Test() {
function Test(botType) {
// Make the test fail if not completed in 3 seconds.
this.timeout_ = setTimeout(
this.fail.bind(this, "Test timeout!"),
3000);
5000);
this.botType_ = botType;
}
Test.prototype = {
@ -71,14 +72,14 @@ Test.prototype = {
// Lazy initialization of botmanager.
if (!this.botManager_)
this.botManager_ = new BotManager();
this.botManager_.spawnNewBot(name, doneCallback);
this.botManager_.spawnNewBot(name, this.botType_, doneCallback);
},
}
function runTest(testfile) {
console.log("Running test: " + testfile);
var script = vm.createScript(fs.readFileSync(testfile), testfile);
script.runInNewContext({ test: new Test() });
script.runInNewContext({ test: new Test(process.argv[2]) });
}
runTest("./test/simple_offer_answer.js");