Removed the 00 API from the fuzz tests.

BUG=

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2950 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-10-18 21:00:03 +00:00
parent 0a02c38345
commit 89b5388c67
2 changed files with 1 additions and 127 deletions

View File

@ -1,122 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<!--
Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file in the root of the source
tree. An additional intellectual property rights grant can be found
in the file PATENTS. All contributing project authors may
be found in the AUTHORS file in the root of the source tree.
-->
<html>
<head>
<title>WebRTC PeerConnection Fuzz Test Template</title>
INCLUDE_RANDOM_JS
INCLUDE_FUZZ_SDP_JS
<script type="text/javascript">
var gFirstConnection = null;
var gSecondConnection = null;
// Variables in caps are filled in by the fuzzer.
var gTransformOfferSdp = TRANSFORM_OFFER_SDP;
var gTransformAnswerSdp = TRANSFORM_ANSWER_SDP;
// START_OF_POSSIBLE_INJECTED_LOCATION_RELOADS
function startTest() {
navigator.webkitGetUserMedia(REQUEST_AUDIO_AND_VIDEO,
getUserMediaOkCallback,
getUserMediaFailedCallback);
}
function getUserMediaFailedCallback(error) {
console.log('getUserMedia request failed with code ' + error.code);
}
function callUsingStream(localStream) {
gFirstConnection = new webkitPeerConnection00(
null, onIceCandidateToFirst);
gFirstConnection.addStream(localStream);
var offer = gFirstConnection.createOffer(null);
gFirstConnection.setLocalDescription(
webkitPeerConnection00.SDP_OFFER, offer);
return offer.toSdp();
}
function receiveCall(offerSdp) {
gSecondConnection = new webkitPeerConnection00(
null, onIceCandidateToSecond);
gSecondConnection.onaddstream = onRemoteStream;
var parsedOffer = new SessionDescription(offerSdp);
gSecondConnection.setRemoteDescription(
webkitPeerConnection00.SDP_OFFER, parsedOffer);
var answer = gSecondConnection.createAnswer(
offerSdp, { has_audio: true, has_video: true });
gSecondConnection.setLocalDescription(
webkitPeerConnection00.SDP_ANSWER, answer);
gSecondConnection.startIce();
return answer.toSdp();
}
function handleAnswer(answerSdp) {
var parsed_answer = new SessionDescription(answerSdp);
gFirstConnection.setRemoteDescription(
webkitPeerConnection00.SDP_ANSWER, parsed_answer);
gFirstConnection.startIce();
}
function getUserMediaOkCallback(localStream) {
var localStreamUrl = webkitURL.createObjectURL(localStream);
document.getElementById('local-view').src = localStreamUrl;
var offerSdp = callUsingStream(localStream);
offerSdp = gTransformOfferSdp(offerSdp);
var answerSdp = receiveCall(offerSdp);
answerSdp = gTransformAnswerSdp(answerSdp);
console.log(offerSdp);
console.log(answerSdp);
handleAnswer(answerSdp);
}
function onIceCandidateToFirst(candidate, more) {
if (candidate) {
gSecondConnection.processIceMessage(candidate);
}
}
function onIceCandidateToSecond(candidate, more) {
if (candidate) {
gFirstConnection.processIceMessage(candidate);
}
}
function onRemoteStream(e) {
var remoteStreamUrl = webkitURL.createObjectURL(e.stream);
document.getElementById('remote-view').src = remoteStreamUrl;
}
window.onload = function() {
setRandomRolls(gRandomRolls);
startTest();
}
// END_OF_POSSIBLE_INJECTED_LOCATION_RELOADS
// This variable is placed here since its value is pretty big.
var gRandomRolls = ARRAY_OF_RANDOM_ROLLS;
</script>
</head>
<body>
<table border="0">
<tr>
<td>Local Preview</td>
<td>Remote Stream</td>
</tr>
<tr>
<td><video width="320" height="240" id="local-view"
autoplay="autoplay"></video></td>
<td><video width="320" height="240" id="remote-view"
autoplay="autoplay"></video></td>
</tr>
</table>
</body>
</html>

View File

@ -71,11 +71,7 @@ def GenerateData(be_nice):
this_scripts_path = os.path.dirname(os.path.realpath(__file__))
corpus_path = os.path.join(this_scripts_path, 'corpus');
# Choose the newest version of the API more often than the old one.
if random.random() < 0.8:
template_to_use = 'template01.html'
else:
template_to_use = 'template00.html'
template_to_use = 'template01.html'
template = _ReadFile(os.path.join(corpus_path, template_to_use))
file_extension = 'html'