Bug 1119593 - Aggressively removing boilerplate on tests, r=drno

Conflicts:
	dom/media/tests/mochitest/test_getUserMedia_exceptions.html

--HG--
extra : rebase_source : 693261260367b4d01d1cf059827700d5b86eee1e
This commit is contained in:
Martin Thomson 2015-01-27 12:35:59 -08:00
Родитель 2407d907e5
Коммит 247f4b3c61
82 изменённых файлов: 407 добавлений и 866 удалений

Просмотреть файл

@ -6,7 +6,6 @@
var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
var Cr = SpecialPowers.Cr;
// Specifies whether we are using fake streams to run this automation
var FAKE_ENABLED = true;
@ -34,7 +33,7 @@ try {
* @param {boolean} [meta.visible=false]
* Visibility of the media elements
*/
function createHTML(meta) {
function realCreateHTML(meta) {
var test = document.getElementById('test');
// Create the head content
@ -48,13 +47,13 @@ function createHTML(meta) {
// Create the body content
var anchor = document.createElement('a');
anchor.setAttribute('target', '_blank');
anchor.textContent = meta.title;
if (meta.bug) {
anchor.setAttribute('href', 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + meta.bug);
} else {
anchor.setAttribute('target', '_blank');
}
anchor.textContent = meta.title;
document.body.insertBefore(anchor, test);
var display = document.createElement('p');
@ -83,14 +82,16 @@ function createMediaElement(type, label) {
var element = document.getElementById(id);
// Sanity check that we haven't created the element already
if (element)
if (element) {
return element;
}
element = document.createElement(type === 'audio' ? 'audio' : 'video');
element.setAttribute('id', id);
element.setAttribute('height', 100);
element.setAttribute('width', 150);
element.setAttribute('controls', 'controls');
element.setAttribute('autoplay', 'autoplay');
document.getElementById('content').appendChild(element);
return element;
@ -122,7 +123,7 @@ function getUserMedia(constraints) {
* @param {Function} aCallback
* Test method to execute after initialization
*/
function runTest(aCallback) {
function realRunTest(aCallback) {
if (window.SimpleTest) {
// Running as a Mochitest.
SimpleTest.waitForExplicitFinish();
@ -169,10 +170,10 @@ function runTest(aCallback) {
* tracks being checked
*/
function checkMediaStreamTracksByType(constraints, type, mediaStreamTracks) {
if(constraints[type]) {
if (constraints[type]) {
is(mediaStreamTracks.length, 1, 'One ' + type + ' track shall be present');
if(mediaStreamTracks.length) {
if (mediaStreamTracks.length) {
is(mediaStreamTracks[0].kind, type, 'Track kind should be ' + type);
ok(mediaStreamTracks[0].id, 'Track id should be defined');
}
@ -512,7 +513,7 @@ function IsMacOSX10_6orOlder() {
if (navigator.platform.indexOf("Mac") == 0) {
var version = Cc["@mozilla.org/system-info;1"]
.getService(SpecialPowers.Ci.nsIPropertyBag2)
.getService(Ci.nsIPropertyBag2)
.getProperty("version");
// the next line is correct: Mac OS 10.6 corresponds to Darwin version 10.x !
// Mac OS 10.7 is Darwin version 11.x. the |version| string we've got here
@ -521,3 +522,11 @@ function IsMacOSX10_6orOlder() {
}
return is106orOlder;
}
(function(){
var el = document.createElement("link");
el.rel = "stylesheet";
el.type = "text/css";
el.href= "/tests/SimpleTest/test.css";
document.head.appendChild(el);
}());

Просмотреть файл

@ -1,7 +1,7 @@
(function(g) {
'use strict';
g.trapIdentityEvents = function(target) {
g.trapIdentityEvents = target => {
var state = {};
var identityEvents = ['idpassertionerror', 'idpvalidationerror',
'identityresult', 'peeridentity'];

Просмотреть файл

@ -1,17 +1,15 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../head.js"></script>
<script type="application/javascript">var scriptRelativePath = "../";</script>
<script type="application/javascript" src="../pc.js"></script>
<script type="application/javascript" src="../templates.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getIdentityAssertion Tests"
title: "getIdentityAssertion Tests",
bug: "942367"
});
function checkIdentity(assertion, identity) {

Просмотреть файл

@ -1,21 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../head.js"></script>
<script type="application/javascript">var scriptRelativePath = "../";</script>
<script type="application/javascript" src="../pc.js"></script>
<script type="application/javascript" src="../templates.js"></script>
<script type="application/javascript" src="../blacksilence.js"></script>
<script type="application/javascript" src="../turnConfig.js"></script>
</head>
<body>
<div id="display"></div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "setIdentityProvider leads to peerIdentity and assertions in SDP"
title: "setIdentityProvider leads to peerIdentity and assertions in SDP",
bug: "942367"
});
var test;

Просмотреть файл

@ -1,19 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../head.js"></script>
<script type="application/javascript">var scriptRelativePath = "../";</script>
<script type="application/javascript" src="../pc.js"></script>
<script type="application/javascript" src="../templates.js"></script>
<script type="application/javascript" src="identityevent.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "setIdentityProvider leads to peerIdentity and assertions in SDP"
title: "setIdentityProvider leads to peerIdentity and assertions in SDP",
bug: "942367"
});
var test;
@ -92,8 +89,6 @@ function theTest() {
}
runNetworkTest(theTest);
</script>
</pre>
</body>

Просмотреть файл

@ -1,23 +1,20 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../head.js"></script>
<script type="application/javascript">var scriptRelativePath = "../";</script>
<script type="application/javascript" src="../pc.js"></script>
<script type="application/javascript" src="../templates.js"></script>
<script type="application/javascript" src="identityevent.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "Identity Provider returning errors is handled correctly"
title: "Identity Provider returning errors is handled correctly",
bug: "942367"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
// first example generates an error
test.setIdentityProvider(test.pcLocal, 'example.com', 'idp.html#error', 'nobody');

Просмотреть файл

@ -213,3 +213,27 @@ LocalMediaStreamPlayback.prototype = Object.create(MediaStreamPlayback.prototype
}
}
});
function runTest(f) {
// Use addEventListener to avoid SimpleTest hacking an .onload assignment
window.addEventListener('load', () => {
SimpleTest.waitForExplicitFinish();
realRunTest(f);
});
}
function createHTML(options) {
window.addEventListener('load', () => {
realCreateHTML(options);
});
}
[
"/tests/SimpleTest/SimpleTest.js",
"head.js"
].forEach(script => {
console.log('msp');
var el = document.createElement("script");
el.src = script;
document.head.appendChild(el);
});

Просмотреть файл

@ -6,6 +6,7 @@ support-files =
constraints.js
dataChannel.js
mediaStreamPlayback.js
network.js
nonTrickleIce.js
pc.js
templates.js

Просмотреть файл

@ -0,0 +1,121 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Query function for determining if any IP address is available for
* generating SDP.
*
* @return false if required additional network setup.
*/
function isNetworkReady() {
// for gonk platform
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var listService = SpecialPowers.Cc["@mozilla.org/network/interface-list-service;1"]
.getService(SpecialPowers.Ci.nsINetworkInterfaceListService);
var itfList = listService.getDataInterfaceList(
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_MMS_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_SUPL_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_IMS_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_DUN_INTERFACES);
var num = itfList.getNumberOfInterface();
for (var i = 0; i < num; i++) {
var ips = {};
var prefixLengths = {};
var length = itfList.getInterface(i).getAddresses(ips, prefixLengths);
for (var j = 0; j < length; j++) {
var ip = ips.value[j];
// skip IPv6 address until bug 797262 is implemented
if (ip.indexOf(":") < 0) {
safeInfo("Network interface is ready with address: " + ip);
return true;
}
}
}
// ip address is not available
safeInfo("Network interface is not ready, required additional network setup");
return false;
}
safeInfo("Network setup is not required");
return true;
}
/**
* Network setup utils for Gonk
*
* @return {object} providing functions for setup/teardown data connection
*/
function getNetworkUtils() {
var url = SimpleTest.getTestFileURL("NetworkPreparationChromeScript.js");
var script = SpecialPowers.loadChromeScript(url);
var utils = {
/**
* Utility for setting up data connection.
*
* @param aCallback callback after data connection is ready.
*/
prepareNetwork: function() {
return new Promise(resolve => {
script.addMessageListener('network-ready', () => {
info("Network interface is ready");
resolve();
});
info("Setting up network interface");
script.sendAsyncMessage("prepare-network", true);
});
},
/**
* Utility for tearing down data connection.
*
* @param aCallback callback after data connection is closed.
*/
tearDownNetwork: function() {
if (!isNetworkReady()) {
info("No network to tear down");
return Promise.resolve();
}
return new Promise(resolve => {
script.addMessageListener('network-disabled', message => {
info("Network interface torn down");
script.destroy();
resolve();
});
info("Tearing down network interface");
script.sendAsyncMessage("network-cleanup", true);
});
}
};
return utils;
}
/**
* Setup network on Gonk if needed and execute test once network is up
*
*/
function startNetworkAndTest() {
if (isNetworkReady()) {
return Promise.resolve();
}
var utils = getNetworkUtils();
// Trigger network setup to obtain IP address before creating any PeerConnection.
return utils.prepareNetwork();
}
/**
* A wrapper around SimpleTest.finish() to handle B2G network teardown
*/
function networkTestFinished() {
var p;
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var utils = getNetworkUtils();
p = utils.tearDownNetwork();
} else {
p = Promise.resolve();
}
return p.then(() => SimpleTest.finish());
}

Просмотреть файл

@ -121,129 +121,16 @@ function removeVP8(sdp) {
return updated_sdp;
}
/**
* Query function for determining if any IP address is available for
* generating SDP.
*
* @return false if required additional network setup.
*/
function isNetworkReady() {
// for gonk platform
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var listService = SpecialPowers.Cc["@mozilla.org/network/interface-list-service;1"]
.getService(SpecialPowers.Ci.nsINetworkInterfaceListService);
var itfList = listService.getDataInterfaceList(
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_MMS_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_SUPL_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_IMS_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_DUN_INTERFACES);
var num = itfList.getNumberOfInterface();
for (var i = 0; i < num; i++) {
var ips = {};
var prefixLengths = {};
var length = itfList.getInterface(i).getAddresses(ips, prefixLengths);
for (var j = 0; j < length; j++) {
var ip = ips.value[j];
// skip IPv6 address until bug 797262 is implemented
if (ip.indexOf(":") < 0) {
safeInfo("Network interface is ready with address: " + ip);
return true;
}
}
}
// ip address is not available
safeInfo("Network interface is not ready, required additional network setup");
return false;
}
safeInfo("Network setup is not required");
return true;
}
/**
* Network setup utils for Gonk
*
* @return {object} providing functions for setup/teardown data connection
*/
function getNetworkUtils() {
var url = SimpleTest.getTestFileURL("NetworkPreparationChromeScript.js");
var script = SpecialPowers.loadChromeScript(url);
var utils = {
/**
* Utility for setting up data connection.
*
* @param aCallback callback after data connection is ready.
*/
prepareNetwork: function() {
return new Promise(resolve => {
script.addMessageListener('network-ready', () => {
info("Network interface is ready");
resolve();
});
info("Setting up network interface");
script.sendAsyncMessage("prepare-network", true);
});
},
/**
* Utility for tearing down data connection.
*
* @param aCallback callback after data connection is closed.
*/
tearDownNetwork: function() {
if (!isNetworkReady()) {
info("No network to tear down");
return Promise.resolve();
}
return new Promise(resolve => {
script.addMessageListener('network-disabled', message => {
info("Network interface torn down");
script.destroy();
resolve();
});
info("Tearing down network interface");
script.sendAsyncMessage("network-cleanup", true);
});
}
};
return utils;
}
/**
* Setup network on Gonk if needed and execute test once network is up
*
*/
function startNetworkAndTest() {
if (isNetworkReady()) {
return Promise.resolve();
}
var utils = getNetworkUtils();
// Trigger network setup to obtain IP address before creating any PeerConnection.
return utils.prepareNetwork();
}
/**
* A wrapper around SimpleTest.finish() to handle B2G network teardown
*/
function networkTestFinished() {
var p;
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var utils = getNetworkUtils();
p = utils.tearDownNetwork();
} else {
p = Promise.resolve();
}
return p.then(() => SimpleTest.finish());
}
/**
* A wrapper around runTest() which handles B2G network setup and teardown
*/
function runNetworkTest(testFunction) {
// Use addEventListener to avoid SimpleTest hacking an .onload assignment
window.addEventListener('load', () => {
SimpleTest.waitForExplicitFinish();
return startNetworkAndTest()
.then(() => runTest(testFunction));
startNetworkAndTest()
.then(() => realRunTest(testFunction));
});
}
/**
@ -1882,3 +1769,26 @@ PeerConnectionWrapper.prototype = {
return "PeerConnectionWrapper (" + this.label + ")";
}
};
function createHTML(options) {
window.addEventListener('load', () => {
realCreateHTML(options);
});
}
[
"/tests/SimpleTest/SimpleTest.js",
"head.js",
"templates.js",
"turnConfig.js",
"dataChannel.js",
"network.js"
].forEach(script => {
var el = document.createElement("script");
if (typeof scriptRelativePath === 'string' && script.charAt(0) !== "/") {
el.src = scriptRelativePath + script;
} else {
el.src = script;
}
document.head.appendChild(el);
});

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="dataChannel.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,30 +1,18 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=781534
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Basic Audio Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=781534">getUserMedia Basic Audio Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<audio id="testAudio"></audio>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Basic Audio Test", bug: "781534" });
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an audio LocalMediaStream on an audio HTMLMediaElement.
*/
runTest(function () {
var testAudio = document.getElementById('testAudio');
var testAudio = createMediaElement('audio', 'testAudio');
var constraints = {audio: true};
getUserMedia(constraints).then(aStream => {

Просмотреть файл

@ -1,24 +1,15 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=983504
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Basic Screenshare Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=983504">getUserMedia Basic Screenshare Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getUserMedia Basic Screenshare Test",
bug: "983504"
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an screenshare LocalMediaStream on a video HTMLMediaElement.
@ -30,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=983504
SimpleTest.finish();
return;
}
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var constraints = {
video: {
mozMediaSource: "screen",

Просмотреть файл

@ -1,30 +1,21 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=781534
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Basic Video Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=781534">getUserMedia Basic Video Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getUserMedia Basic Video Test",
bug: "781534"
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an video LocalMediaStream on a video HTMLMediaElement.
*/
runTest(function () {
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var constraints = {video: true};
getUserMedia(constraints).then(aStream => {

Просмотреть файл

@ -1,30 +1,21 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=781534
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Basic Video & Audio Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=781534">getUserMedia Basic Video & Audio Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideoAudio"></video>
</div>
<pre id="test">
<script type="application/javascript">
<script type="application/javascript">
createHTML({
title: "getUserMedia Basic Video & Audio Test",
bug: "781534"
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for a video and audio LocalMediaStream on a video HTMLMediaElement.
*/
runTest(function () {
var testVideoAudio = document.getElementById('testVideoAudio');
var testVideoAudio = createMediaElement('video', 'testVideoAudio');
var constraints = {video: true, audio: true};
getUserMedia(constraints).then(aStream => {

Просмотреть файл

@ -1,24 +1,15 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=983504
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Basic Windowshare Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1038926">getUserMedia Basic Windowshare Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getUserMedia Basic Windowshare Test",
bug: "1038926"
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an screenshare LocalMediaStream on a video HTMLMediaElement.
@ -30,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=983504
SimpleTest.finish();
return;
}
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var constraints = {
video: {
mozMediaSource: "window",

Просмотреть файл

@ -1,29 +1,20 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=781534
-->
<head>
<meta charset="utf-8">
<title>navigator.mozGetUserMedia Callback Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank">navigator.mozGetUserMedia Callback Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<audio id="testAudio"></audio>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "navigator.mozGetUserMedia Callback Test",
bug: "1119593"
});
/**
* Check that the old fashioned callback-based function works.
*/
runTest(function () {
var testAudio = document.getElementById('testAudio');
var testAudio = createMediaElement('audio', 'testAudio');
var constraints = {audio: true};
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -1,24 +1,13 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=882145
-->
<head>
<meta charset="utf-8">
<title>Test mozGetUserMedia Constraints</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="constraints.js"></script>
<script src="mediaStreamPlayback.js"></script>
<script src="constraints.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882145">Test mozGetUserMedia Constraints (desktop)</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "Test getUserMedia constraints (desktop)", bug: "882145" });
/**
See constraints.js for testConstraints() and common_tests.
TODO(jib): Merge desktop and mobile version of these tests again (Bug 997365)

Просмотреть файл

@ -1,24 +1,13 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=882145
-->
<head>
<meta charset="utf-8">
<title>Test mozGetUserMedia Constraints</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="constraints.js"></script>
<script src="mediaStreamPlayback.js"></script>
<script src="constraints.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882145">Test mozGetUserMedia Constraints (mobile)</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "Test getUserMedia constraints (mobile)", bug: "882145" });
/**
See constraints.js for testConstraints() and common_tests.
TODO(jib): Merge desktop and mobile version of these tests again (Bug 997365)

Просмотреть файл

@ -1,25 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia gum within gum</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia gum within gum</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
<audio id="testAudio"></audio>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({title: "getUserMedia within getUserMedia", bug: "822109" });
/**
* Run a test that we can complete a playback cycle for a video,
* then upon completion, do a playback cycle with audio, such that
@ -28,18 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({video: true})
.then(videoStream => {
var testVideo = document.getElementById('testVideo');
var videoStreamPlayback = new LocalMediaStreamPlayback(testVideo,
var testVideo = createMediaElement('video', 'testVideo');
var videoPlayback = new LocalMediaStreamPlayback(testVideo,
videoStream);
return videoStreamPlayback.playMedia(false)
return videoPlayback.playMedia(false)
.then(() => getUserMedia({audio: true}))
.then(audioStream => {
var testAudio = document.getElementById('testAudio');
var audioStreamPlayback = new LocalMediaStreamPlayback(testAudio,
var testAudio = createMediaElement('audio', 'testAudio');
var audioPlayback = new LocalMediaStreamPlayback(testAudio,
audioStream);
return audioStreamPlayback.playMedia(false)
return audioPlayback.playMedia(false)
.then(() => audioStream.stop());
})
.then(() => videoStream.stop());

Просмотреть файл

@ -1,24 +1,13 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=942367
-->
<head>
<meta charset="utf-8">
<title>Test mozGetUserMedia peerIdentity Constraint</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="blacksilence.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=942367">Test mozGetUserMedia peerIdentity Constraint</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "Test getUserMedia peerIdentity Constraint", bug: "942367" });
function theTest() {
function testPeerIdentityConstraint(withConstraint, done) {
var config = { audio: true, video: true, fake: true };

Просмотреть файл

@ -1,35 +1,22 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Play Audio Twice</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Play Audio Twice</a>
<p id="display"></p>
<div id="content" style="display: none">
<audio id="testAudio"></audio>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({title: "getUserMedia Play Audio Twice", bug: "822109" });
/**
* Run a test that we can complete an audio playback cycle twice in a row.
*/
runTest(function () {
getUserMedia({audio: true}).then(audioStream => {
var testAudio = document.getElementById('testAudio');
var audioStreamPlayback = new LocalMediaStreamPlayback(testAudio,
audioStream);
var testAudio = createMediaElement('audio', 'testAudio');
var playback = new LocalMediaStreamPlayback(testAudio, audioStream);
return audioStreamPlayback.playMedia(false)
.then(() => audioStreamPlayback.playMedia(true))
return playback.playMedia(false)
.then(() => playback.playMedia(true))
.then(() => audioStream.stop());
}).then(() => SimpleTest.finish(), generateErrorCallback());
});

Просмотреть файл

@ -1,34 +1,22 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Play Video and Audio Twice</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Play Video and Audio Twice</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({title: "getUserMedia Play Video and Audio Twice", bug: "822109" });
/**
* Run a test that we can complete a video playback cycle twice in a row.
*/
runTest(function () {
getUserMedia({video: true, audio: true}).then(stream => {
var testVideo = document.getElementById('testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
var testVideo = createMediaElement('video', 'testVideo');
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMedia(false)
.then(() => streamPlayback.playMedia(true))
return playback.playMedia(false)
.then(() => playback.playMedia(true))
.then(() => stream.stop());
}).then(() => SimpleTest.finish(), generateErrorCallback());
});

Просмотреть файл

@ -1,30 +1,18 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Play Video Twice</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Play Video Twice</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Play Video Twice", bug: "822109" });
/**
* Run a test that we can complete a video playback cycle twice in a row.
*/
runTest(function () {
getUserMedia({video: true}).then(stream => {
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMedia(false)

Просмотреть файл

@ -1,24 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Audio Stream</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Audio Stream</a>
<p id="display"></p>
<div id="content" style="display: none">
<audio id="testAudio"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Audio Stream", bug: "822109" });
/**
* Run a test to verify that we can start an audio stream in a media element,
* call stop() on the stream, and successfully get an ended event fired.
@ -26,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({audio: true})
.then(stream => {
var testAudio = document.getElementById('testAudio');
var testAudio = createMediaElement('audio', 'testAudio');
var streamPlayback = new LocalMediaStreamPlayback(testAudio, stream);
return streamPlayback.playMediaWithStreamStop(false);

Просмотреть файл

@ -1,24 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Audio Stream With Followup Audio</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Audio Stream With Followup Audio</a>
<p id="display"></p>
<div id="content" style="display: none">
<audio id="testAudio"></audio>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Audio Stream With Followup Audio", bug: "822109" });
/**
* Run a test to verify that I can complete an audio gum playback in a media
* element, stop the stream, and then complete another audio gum playback
@ -27,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({audio: true})
.then(firstStream => {
var testAudio = document.getElementById('testAudio');
var testAudio = createMediaElement('audio', 'testAudio');
var streamPlayback = new LocalMediaStreamPlayback(testAudio, firstStream);
return streamPlayback.playMediaWithStreamStop(false)

Просмотреть файл

@ -1,24 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Video Audio Stream</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Video Audio Stream</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Audio Stream", bug: "822109" });
/**
* Run a test to verify that we can start a video+audio stream in a
* media element, call stop() on the stream, and successfully get an
@ -27,10 +15,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({video: true, audio: true})
.then(stream => {
var testVideo = document.getElementById('testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
var testVideo = createMediaElement('video', 'testVideo');
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithStreamStop(false);
return playback.playMediaWithStreamStop(false);
})
.then(() => SimpleTest.finish(), generateErrorCallback());
});

Просмотреть файл

@ -1,24 +1,15 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Video+Audio Stream With Followup Video+Audio</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Video+Audio Stream With Followup Video+Audio</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getUserMedia Stop Video+Audio Stream With Followup Video+Audio",
bug: "822109"
});
/**
* Run a test to verify that I can complete an video+audio gum playback in a
* media element, stop the stream, and then complete another video+audio gum
@ -27,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({video: true, audio: true})
.then(stream => {
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithStreamStop(false)

Просмотреть файл

@ -1,24 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Video Stream</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Video Audio Stream</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Stream", bug: "822109" });
/**
* Run a test to verify that we can start a video stream in a
* media element, call stop() on the stream, and successfully get an
@ -27,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({video: true})
.then(stream => {
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithStreamStop(false);

Просмотреть файл

@ -1,24 +1,12 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822109
-->
<head>
<meta charset="utf-8">
<title>getUserMedia Stop Video Stream With Followup Video</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">getUserMedia Stop Video Stream With Followup Video</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Stream With Followup Video", bug: "822109" });
/**
* Run a test to verify that I can complete an video gum playback in a
* media element, stop the stream, and then complete another video gum
@ -27,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
runTest(function () {
getUserMedia({video: true})
.then(stream => {
var testVideo = document.getElementById('testVideo');
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithStreamStop(false)

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -6,14 +6,8 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="long.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -25,7 +19,7 @@
});
var test;
runTest(function (options) {
runNetworkTest(function (options) {
options = options || {};
options.commands = commandsPeerConnection.slice(0);
options.commands.push(generateIntervalCommand(verifyConnectionStatus,
@ -41,4 +35,3 @@
</pre>
</body>
</html>

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,11 +11,8 @@
title: "Basic audio/video peer connection with no Bundle"
});
SimpleTest.requestFlakyTimeout("WebRTC is full of inherent timeouts");
var test;
runNetworkTest(function (options) {
test = new PeerConnectionTest(options);
runNetworkTest(options => {
var test = new PeerConnectionTest(options);
test.chain.insertAfter(
'PC_LOCAL_CREATE_OFFER',
[

Просмотреть файл

@ -6,14 +6,8 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="long.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -6,14 +6,8 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="long.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
@ -14,7 +11,7 @@
title: "RTCConfiguration valid/invalid permutations"
});
makePC = (config, expected_error) => {
var makePC = (config, expected_error) => {
var exception;
try {
new mozRTCPeerConnection(config).close();
@ -23,11 +20,10 @@
}
is((exception? exception.name : "success"), expected_error || "success",
"mozRTCPeerConnection(" + JSON.stringify(config) + ")");
}
};
// This is a test of the iceServers parsing code + readable errors
runNetworkTest(function () {
// This is a test of the iceServers parsing code + readable errors
runNetworkTest(() => {
var exception = null;
try {
@ -68,6 +64,7 @@
makePC({ iceServers: [{ url:"turns:localhost:3478", credential:"p" }] }, "InvalidAccessError");
makePC({ iceServers: [{ urls:"http:0.0.0.0" }] }, "SyntaxError");
try {
new mozRTCPeerConnection({ iceServers: [{ url:"http:0.0.0.0" }] }).close();
} catch (e) {
@ -76,7 +73,7 @@
}
networkTestFinished();
});
});
</script>
</pre>
</body>

Просмотреть файл

@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,26 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<video id="v1" controls="controls" height="120" width="160" autoplay></video>
<video id="v2" controls="controls" height="120" width="160" autoplay></video><br>
<pre id="test">
<script type="application/javascript;version=1.8">
createHTML({
title: "PeerConnection using callback functions",
bug: "1119593",
visible: true
});
// This still aggressively uses promises, but it is testing that the callback functions
// are properly in place.
var waituntil = func => new Promise(resolve => {
var inter = setInterval(() => func() && resolve(clearInterval(inter)), 200);
});
// wrapper that turns a callback-based function call into a promise
function pcall(o, f, beforeArg) {
@ -57,15 +50,18 @@ pc2.onicecandidate = e => {
.catch(generateErrorCallback());
};
var v1, v2;
var delivered = new Promise(resolve => {
pc2.onaddstream = e => {
v2.mozSrcObject = e.stream;
resolve(e.stream);
};
});
var canPlayThrough = new Promise(resolve => v2.canplaythrough = resolve);
runNetworkTest(function() {
v1 = createMediaElement('video', 'v1');
v2 = createMediaElement('video', 'v2');
var canPlayThrough = new Promise(resolve => v2.canplaythrough = resolve);
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
// not testing legacy gUM here
@ -79,7 +75,7 @@ runNetworkTest(function() {
.then(() => pcall(pc1, pc1.setRemoteDescription, pc2.localDescription))
.then(() => delivered)
// .then(() => canPlayThrough) // why doesn't this fire?
.then(() => waituntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
.then(() => waitUntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
.then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
.then(() => ok(true, "Connected."))
.then(() => pcall(pc1, pc1.getStats, null))

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<video id="v1" src="../../test/vp9cake.webm" height="120" width="160" autoplay muted></video>

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,9 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,14 +1,8 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="nonTrickleIce.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,14 +1,8 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="nonTrickleIce.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,14 +1,8 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="nonTrickleIce.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,14 +1,9 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<video id="v1" controls="controls" height="120" width="160" autoplay></video>
<video id="v2" controls="controls" height="120" width="160" autoplay></video><br>
<pre id="test">
<script type="application/javascript;version=1.8">
createHTML({
@ -17,10 +12,6 @@
visible: true
});
var waituntil = func => new Promise(resolve => {
var inter = setInterval(() => func() && resolve(clearInterval(inter)), 200);
});
var pc1 = new mozRTCPeerConnection();
var pc2 = new mozRTCPeerConnection();
@ -34,11 +25,15 @@
pc2.onicecandidate = e => pc1_stable.then(() => !e.candidate ||
pc1.addIceCandidate(e.candidate)).catch(generateErrorCallback());
var v1, v2;
var delivered = new Promise(resolve =>
pc2.onaddstream = e => resolve(v2.mozSrcObject = e.stream));
var canPlayThrough = new Promise(resolve => v2.canplaythrough = e => resolve());
runNetworkTest(function() {
v1 = createMediaElement('video', 'v1');
v2 = createMediaElement('video', 'v2');
var canPlayThrough = new Promise(resolve => v2.canplaythrough = e => resolve());
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
navigator.mediaDevices.getUserMedia({ fake: true, video: true, audio: true })
@ -51,7 +46,7 @@
.then(() => pc1.setRemoteDescription(pc2.localDescription))
.then(() => delivered)
// .then(() => canPlayThrough) // why doesn't this fire?
.then(() => waituntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
.then(() => waitUntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
.then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
.then(() => ok(true, "Connected."))
.catch(reason => ok(false, "unexpected failure: " + reason))

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setLocalDescription (answer) in 'have-local-offer'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setLocalDescription (answer) in 'stable'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_LOCAL_CREATE_OFFER");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setLocalDescription (offer) in 'have-remote-offer'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setRemoteDescription (answer) in 'have-remote-offer'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setRemoteDescription (answer) in 'stable'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_LOCAL_CREATE_OFFER");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">
@ -17,9 +11,8 @@
title: "setRemoteDescription (offer) in 'have-local-offer'"
});
var test;
runNetworkTest(function () {
test = new PeerConnectionTest();
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.removeAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION");

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,10 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
@ -15,9 +11,23 @@
title: "Throw in PeerConnection callbacks"
});
runNetworkTest(function () {
function finish() {
window.onerror = oldOnError;
is(error_count, 7, "Seven expected errors verified.");
networkTestFinished();
}
function getFail() {
return err => {
window.onerror = oldOnError;
generateErrorCallback()(err);
};
}
let error_count = 0;
let oldOnError = window.onerror;
window.onerror = function (errorMsg, url, lineNumber) {
window.onerror = (errorMsg, url, lineNumber) => {
if (errorMsg.indexOf("Expected") == -1) {
getFail()(errorMsg);
}
@ -31,10 +41,6 @@
}
let pc0, pc1, pc2;
runNetworkTest(function () {
error_count = 0;
// Test failure callbacks (limited to 1 for now)
pc0 = new mozRTCPeerConnection();
pc0.createOffer(getFail(), function(err) {
@ -65,20 +71,8 @@
}, getFail());
throw new Error("Expected");
});
});
});
function finish() {
window.onerror = oldOnError;
is(error_count, 7, "Seven expected errors verified.");
networkTestFinished();
}
function getFail() {
return function (err) {
window.onerror = oldOnError;
generateErrorCallback()(err);
};
}
</script>
</pre>
</body>

Просмотреть файл

@ -1,14 +1,6 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=872377
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 872377 and Bug 928304</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script type="application/javascript" src="templates.js"></script>
<script type="application/javascript" src="turnConfig.js"></script>
</head>
<body>
<pre id="test">

Просмотреть файл

@ -1,24 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="pc.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="network.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var utils = getNetworkUtils();
utils.tearDownNetwork(function() {
ok(true, 'Successfully teared down network interface');
SimpleTest.finish();
}, function() {
ok(true, 'Network interface was in down state already');
SimpleTest.finish();
});
getNetworkUtils().tearDownNetwork()
.then(() =>
ok(true, 'Successfully teared down network interface'),
() =>
ok(true, 'Network interface was in down state already'))
.then(() => SimpleTest.finish());
} else {
ok(true, 'No need to cleanup network interface');
SimpleTest.finish();