-<!DOCTYPE html>
+<!doctype html>
+<!--
+To quickly iterate when developing this test, use --use-fake-ui-for-media-stream
+for Chrome and set the media.navigator.permission.disabled property to true in
+Firefox. You must either have a webcam/mic available on the system or use for
+instance --use-fake-device-for-media-stream for Chrome.
+ -->
+
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RTCPeerConnection Connection Test</title>
-
</head>
-
<body>
-
-<div>
- <video width="320" height="240" id="remote-view" autoplay="autoplay"></video>
- <video width="320" height="240" id="local-view" autoplay="autoplay"></video>
-</div>
-<div id="log"></div>
+ <div id="log"></div>
+ <div>
+ <video id="local-view" autoplay="autoplay"></video>
+ <video id="remote-view" autoplay="autoplay"/>
+ </video>
+ </div>
+
+ <!-- These files are in place when executing on W3C. -->
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
- <script src="/common/vendor-prefix.js"
- data-prefixed-objects= '[{"ancestors":["navigator"], "name":"getUserMedia"},
- {"ancestors":["window"], "name":"RTCPeerConnection"}]'
- data-prefixed-prototypes='[{"ancestors":["HTMLMediaElement"],"name":"srcObject"}]'></script>
+ <script src="../../../resources/vendor-prefix.js"
+ data-prefixed-objects=
+ '[{"ancestors":["navigator"], "name":"getUserMedia"},
+ {"ancestors":["window"], "name":"RTCPeerConnection"},
+ {"ancestors":["window"], "name":"RTCSessionDescription"},
+ {"ancestors":["window"], "name":"RTCIceCandidate"}]'
+ data-prefixed-prototypes=
+ '[{"ancestors":["HTMLMediaElement"],"name":"srcObject"}]'>
+ </script>
<script type="text/javascript">
var test = async_test('Can set up a basic WebRTC call.', {timeout: 5000});
+
var gFirstConnection = null;
var gSecondConnection = null;
function getUserMediaOkCallback(localStream) {
- gFirstConnection = new RTCPeerConnection();
+ gFirstConnection = new RTCPeerConnection(null, null);
gFirstConnection.onicecandidate = onIceCandidateToFirst;
gFirstConnection.addStream(localStream);
- gFirstConnection.createOffer(onOfferCreated);
+ gFirstConnection.createOffer(onOfferCreated, failed('createOffer'));
var videoTag = document.getElementById('local-view');
videoTag.srcObject = localStream;
});
function receiveCall(offerSdp) {
- gSecondConnection = new RTCPeerConnection();
+ gSecondConnection = new RTCPeerConnection(null, null);
gSecondConnection.onicecandidate = onIceCandidateToSecond;
gSecondConnection.onaddstream = onRemoteStream;
failed('getUserMedia'));
});
</script>
+
</body>
</html>