webrtc-troubleshoot
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "webrtc-troubleshoot", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A way to add webrtc troubleshooting to your app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,3 @@ import TestSuite from '../utils/TestSuite'; | ||
this.tests = []; | ||
this.deferred = Promise.defer(); | ||
@@ -21,3 +22,3 @@ this.addTest(new CameraResolutionTest([[320, 240]], options)); | ||
start () { | ||
return super.start(); | ||
return super.start().then(this.deferred.resolve, this.deferred.reject); | ||
} | ||
@@ -24,0 +25,0 @@ |
@@ -12,2 +12,6 @@ /* global WebRTCTroubleshooter */ | ||
const testCompleted = function (test, success) { | ||
console.log('test completed', test.name, success ? 'success' : 'failure'); | ||
}; | ||
runButton.onclick = function startTroubleshooter () { | ||
@@ -32,3 +36,3 @@ if (!navigator.mediaDevices) { | ||
const audioTest = new webRTCTroubleshooter.AudioTest(mediaOptions); | ||
audioTest.deferred.promise.then(testCompleted.bind(null, audioTest, true), testCompleted.bind(null, audioTest, false)); | ||
testSuite.addTest(audioTest); | ||
@@ -39,4 +43,7 @@ } | ||
const videoTest = new webRTCTroubleshooter.VideoTest(mediaOptions); | ||
videoTest.deferred.promise.then(testCompleted.bind(null, videoTest, true), testCompleted.bind(null, videoTest, false)); | ||
const advancedCameraTest = new webRTCTroubleshooter.AdvancedCameraTest(mediaOptions); | ||
advancedCameraTest.deferred.promise.then(testCompleted.bind(null, advancedCameraTest, true), testCompleted.bind(null, advancedCameraTest, false)); | ||
const bandwidthTest = new webRTCTroubleshooter.VideoBandwidthTest({ iceConfig: iceConfig, mediaOptions: mediaOptions }); | ||
bandwidthTest.deferred.promise.then(testCompleted.bind(null, bandwidthTest, true), testCompleted.bind(null, bandwidthTest, false)); | ||
@@ -50,3 +57,5 @@ testSuite.addTest(videoTest); | ||
const connectivityTest = new webRTCTroubleshooter.ConnectivityTest(iceConfig); | ||
connectivityTest.deferred.promise.then(testCompleted.bind(null, connectivityTest, true), testCompleted.bind(null, connectivityTest, false)); | ||
const throughputTest = new webRTCTroubleshooter.ThroughputTest(iceConfig); | ||
throughputTest.deferred.promise.then(testCompleted.bind(null, throughputTest, true), testCompleted.bind(null, throughputTest, false)); | ||
@@ -53,0 +62,0 @@ testSuite.addTest(connectivityTest); |
Sorry, the diff of this file is too big to display
331654
8380