Title: [108299] trunk/LayoutTests
Revision
108299
Author
[email protected]
Date
2012-02-20 21:25:05 -0800 (Mon, 20 Feb 2012)

Log Message

 There is no complete test cases of optional arguments for MediaStream API and PeerConnection
 https://bugs.webkit.org/show_bug.cgi?id=78578

 Reviewed by Adam Barth.

 * fast/mediastream/peerconnection-AttributesMethod-expected.txt: Added.
 * fast/mediastream/peerconnection-AttributesMethod.html: Added.
 * fast/mediastream/peerconnection-addstream-expected.txt:
 * fast/mediastream/peerconnection-argument-types-expected.txt: Added.
 * fast/mediastream/peerconnection-argument-types.html: Added.
 * fast/mediastream/peerconnection-removestream-expected.txt: Added.
 * fast/mediastream/peerconnection-removestream.html: Added.
 * fast/mediastream/script-tests/AttributesMethod.js: Added.
 * fast/mediastream/script-tests/argument-types.js: Added.
 * fast/mediastream/script-tests/peerconnection-addstream.js:
 * fast/mediastream/script-tests/peerconnection-removestream.js: Added.

Patch by Yanbin Zhang <[email protected]> on 2012-02-20

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (108298 => 108299)


--- trunk/LayoutTests/ChangeLog	2012-02-21 05:21:16 UTC (rev 108298)
+++ trunk/LayoutTests/ChangeLog	2012-02-21 05:25:05 UTC (rev 108299)
@@ -1,3 +1,22 @@
+2012-02-20  Yanbin Zhang  <[email protected]>
+
+         There is no complete test cases of optional arguments for MediaStream API and PeerConnection
+         https://bugs.webkit.org/show_bug.cgi?id=78578
+
+         Reviewed by Adam Barth.
+
+         * fast/mediastream/peerconnection-AttributesMethod-expected.txt: Added.
+         * fast/mediastream/peerconnection-AttributesMethod.html: Added.
+         * fast/mediastream/peerconnection-addstream-expected.txt:
+         * fast/mediastream/peerconnection-argument-types-expected.txt: Added.
+         * fast/mediastream/peerconnection-argument-types.html: Added.
+         * fast/mediastream/peerconnection-removestream-expected.txt: Added.
+         * fast/mediastream/peerconnection-removestream.html: Added.
+         * fast/mediastream/script-tests/AttributesMethod.js: Added.
+         * fast/mediastream/script-tests/argument-types.js: Added.
+         * fast/mediastream/script-tests/peerconnection-addstream.js:
+         * fast/mediastream/script-tests/peerconnection-removestream.js: Added.
+
 2012-02-20  Yuta Kitamura  <[email protected]>
 
         [Chromium] Unreviewed, update test expectations.

Added: trunk/LayoutTests/fast/mediastream/peerconnection-Attributes-expected.txt (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-Attributes-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-Attributes-expected.txt	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,32 @@
+Tests PeerToPeerConnection related Attributes according to http://www.w3.org/TR/webrtc/
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof pc.addStream == 'function' is true
+PASS typeof pc.removeStream == 'function' is true
+PASS typeof pc.close == 'function' is true
+PASS pc.NEW ==0 is true
+PASS pc.NEGOTIATING == 1 is true
+PASS pc.ACTIVE == 2 is true
+PASS pc.CLOSED == 3 is true
+FAIL pc.ICE_GATHERING == 0x100  should be true. Was false.
+FAIL pc.ICE_WAITING == 0x200 should be true. Was false.
+FAIL pc.ICE_CHECKING == 0x300 should be true. Was false.
+FAIL pc.ICE_CONNECTED == 0x400 should be true. Was false.
+FAIL pc.ICE_COMPLETED == 0x500 should be true. Was false.
+FAIL pc.ICE_FAILED == 0x600 should be true. Was false.
+FAIL pc.ICE_CLOSED == 0x700 should be true. Was false.
+FAIL pc.SDP_IDLE == 0x1000 should be true. Was false.
+FAIL pc.SDP_WAITING == 0x2000 should be true. Was false.
+FAIL pc.SDP_GLARE ==0x3000 should be true. Was false.
+PASS typeof pc.localStreams == 'object' is true
+PASS typeof pc.remoteStreams == 'object' is true
+PASS typeof pc._onaddstream_ == 'object' is true
+PASS typeof pc._onremovestream_ == 'object' is true
+PASS typeof pc._onconnecting_ == 'object' is true
+PASS typeof pc._onopen_ == 'object' is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/mediastream/peerconnection-Attributes.html (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-Attributes.html	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-Attributes.html	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/fast/mediastream/peerconnection-addstream-expected.txt (108298 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-addstream-expected.txt	2012-02-21 05:21:16 UTC (rev 108298)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-addstream-expected.txt	2012-02-21 05:25:05 UTC (rev 108299)
@@ -7,6 +7,10 @@
 PASS pc.addStream(undefined) threw Error: TYPE_MISMATCH_ERR: DOM Exception 17
 PASS pc.addStream(null) threw Error: TYPE_MISMATCH_ERR: DOM Exception 17
 PASS pc.addStream(new Array()) threw TypeError: Type error
+PASS pc.addStream({}) threwTypeError: Type error
+PASS pc.addStream(42) threwTypeError: Type error
+PASS pc.addStream(Infinity) threwTypeError: Type error
+PASS pc.addStream(-Infinity) threwTypeError: Type error
 PASS successfullyParsed is true
 
 TEST COMPLETE

Added: trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,55 @@
+Tests the acceptable types for arguments to method for PeerToPeerConnection defination.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof webkitPeerConnection== 'function' is true
+PASS new webkitPeerConnection() threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUN 203.0.113.2:2478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUN relay.example.net:3478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUN example.net") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUNS 203.0.113.2:2478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUNS relay.example.net:3478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUNS example.net") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURN 203.0.113.2:2478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURN relay.example.net:3478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURN example.net") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURNS 203.0.113.2:2478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURNS relay.example.net:3478") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURNS example.net") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURN NONE") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("TURNS NONE") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUN NONE") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUNS NONE") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("undefined") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("null") threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection({})) threw exception SyntaxError: Unexpected token ).
+PASS new webkitPeerConnection(42)) threw exception SyntaxError: Unexpected token ).
+PASS new webkitPeerConnection(Infinity) threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection(-Infinity) threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection(emptyFunction) threw exception TypeError: Not enough arguments.
+PASS new webkitPeerConnection("STUN 203.0.113.2:2478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUN relay.example.net:3478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUN example.net",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUNS 203.0.113.2:2478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUNS relay.example.net:3478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUNS example.net",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURN 203.0.113.2:2478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURN relay.example.net:3478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURN example.net",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURNS 203.0.113.2:2478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURNS relay.example.net:3478",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURNS example.net",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURN NONE",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURNS NONE",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUN NONE",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("STUNS NONE",emptyFunction) did not throw exception.
+PASS new webkitPeerConnection("TURN NONE",undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new webkitPeerConnection("TURNS NONE",{}) did not throw exception.
+PASS new webkitPeerConnection("STUN NONE",42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new webkitPeerConnection("STUNS NONE",Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new webkitPeerConnection("STUNS NONE",-Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/mediastream/peerconnection-argument-types.html (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-argument-types.html	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-argument-types.html	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/mediastream/peerconnection-removestream-expected.txt (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-removestream-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-removestream-expected.txt	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,17 @@
+Tests PeerConnection::removeStream().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS pc.removeStream() threw TypeError: Not enough arguments
+PASS pc.removeStream(undefined) threw Error: TYPE_MISMATCH_ERR: DOM Exception 17
+PASS pc.removeStream(null) threw Error: TYPE_MISMATCH_ERR: DOM Exception 17
+PASS pc.removeStream(new Array()) threw TypeError: Type error
+PASS pc.removeStream({}) threwTypeError: Type error
+PASS pc.removeStream(42) threwTypeError: Type error
+PASS pc.removeStream(Infinity) threwTypeError: Type error
+PASS pc.removeStream(-Infinity) threwTypeError: Type error
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/mediastream/peerconnection-removestream.html (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/peerconnection-removestream.html	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-removestream.html	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/mediastream/script-tests/Attributes.js (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/script-tests/Attributes.js	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/Attributes.js	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,106 @@
+description("Tests PeerToPeerConnection related Attributes according to http://www.w3.org/TR/webrtc/");
+var stream;
+function shouldNotThrow(_expression_)
+{
+  try {
+    eval(_expression_);
+    testPassed(_expression_ + " did not throw exception.");
+  } catch(e) {
+    testFailed(_expression_ + " should not throw exception. Threw exception " + e);
+  }
+}
+
+function test(_expression_, expressionShouldThrow, expectedException) {
+    if (expressionShouldThrow) {
+        if (expectedException)
+            shouldThrow(_expression_, '(function() { return "' + expectedException + '"; })();');
+        else
+            shouldThrow(_expression_, '(function() { return "TypeError: Type error"; })();');
+    } else {
+        shouldNotThrow(_expression_);
+    }
+}
+function shouldBeA(_a, _b, quiet)
+{
+  if (typeof _a != "string" || typeof _b != "string")
+    debug("WARN: shouldBe() expects string arguments");
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+  var _bv = eval(_b);
+
+  if (exception)
+    testFailed(_a + " should be " + _bv + ". Threw exception " + exception);
+  else if (isResultCorrect(_av, _bv)) {
+    if (!quiet) {
+        testPassed(_a + " is " + _b);
+    }
+  } else if (typeof(_av) == typeof(_bv))
+    testFailed(_a + " should be " + _bv + ". Was " + stringify(_av) + ".");
+  else
+    testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
+}
+
+function shouldBeTrueA(_a) { shouldBeA(_a, "true"); }
+
+var toStringError = new Error('toString threw exception');
+var notSupportedError = new Error('NOT_SUPPORTED_ERR: DOM Exception 9');
+var emptyFunction = function() {};
+
+
+function ObjectThrowingException() {};
+ObjectThrowingException.prototype.toString = function() {
+    throw toStringError;
+}
+var objectThrowingException = new ObjectThrowingException();
+
+
+navigator.webkitGetUserMedia("video", gotStream, gotStreamFailed);
+function gotStream(s) {
+stream = s;
+}
+
+function gotStreamFailed(error) {
+  alert("Failed to get access to webcam. Error code was " + error.code);
+}
+
+
+var pc=new webkitPeerConnection("STUN NONE", emptyFunction);
+//method
+shouldBeTrueA("typeof pc.addStream == 'function'");
+shouldBeTrueA("typeof pc.removeStream == 'function'");
+shouldBeTrueA("typeof pc.close == 'function'");
+
+//peerconnection readyState 
+shouldBeTrueA("pc.NEW ==0");
+shouldBeTrueA("pc.NEGOTIATING == 1");
+shouldBeTrueA("pc.ACTIVE == 2");
+shouldBeTrueA("pc.CLOSED == 3");
+
+//iceState and SDP state
+shouldBeTrueA("pc.ICE_GATHERING == 0x100 ");
+shouldBeTrueA("pc.ICE_WAITING == 0x200");
+shouldBeTrueA("pc.ICE_CHECKING == 0x300");
+shouldBeTrueA("pc.ICE_CONNECTED == 0x400");
+shouldBeTrueA("pc.ICE_COMPLETED == 0x500");
+shouldBeTrueA("pc.ICE_FAILED == 0x600");
+shouldBeTrueA("pc.ICE_CLOSED == 0x700");
+shouldBeTrueA("pc.SDP_IDLE == 0x1000");
+shouldBeTrueA("pc.SDP_WAITING == 0x2000");
+shouldBeTrueA("pc.SDP_GLARE ==0x3000");
+
+//MediaStream[] attribute
+shouldBeTrueA("typeof pc.localStreams == 'object'");
+shouldBeTrueA("typeof pc.remoteStreams == 'object'");
+
+//callback function definition 
+shouldBeTrueA("typeof pc._onaddstream_ == 'object'");
+shouldBeTrueA("typeof pc._onremovestream_ == 'object'");
+shouldBeTrueA("typeof pc._onconnecting_ == 'object'");
+shouldBeTrueA("typeof pc._onopen_ == 'object'");
+
+window.jsTestIsAsync = false;

Added: trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,89 @@
+description("Tests the acceptable types for arguments to method for PeerToPeerConnection defination.");
+
+function shouldNotThrow(_expression_)
+{
+  try {
+    eval(_expression_);
+    testPassed(_expression_ + " did not throw exception.");
+  } catch(e) {
+    testFailed(_expression_ + " should not throw exception. Threw exception " + e);
+  }
+}
+
+function test(_expression_, expressionShouldThrow, expectedException) {
+    if (expressionShouldThrow) {
+        if (expectedException)
+            shouldThrow(_expression_, '(function() { return "' + expectedException + '"; })();');
+        else
+            shouldThrow(_expression_, '(function() { return "Error: TYPE_MISMATCH_ERR: DOM Exception 17"; })();');
+    } else {
+        shouldNotThrow(_expression_);
+    }
+}
+
+var toStringError = new Error('toString threw exception');
+var notSupportedError = new Error('NOT_SUPPORTED_ERR: DOM Exception 9');
+var emptyFunction = function() {};
+
+function ObjectThrowingException() {};
+ObjectThrowingException.prototype.toString = function() {
+    throw toStringError;
+}
+var objectThrowingException = new ObjectThrowingException();
+
+shouldBeTrue("typeof webkitPeerConnection== 'function'");
+
+// 0 Argument
+test('new webkitPeerConnection()', true,'TypeError: Not enough arguments');
+
+// 1 Argument (new webkitPeerConnection requires at least 2 arguments).
+test('new webkitPeerConnection("STUN 203.0.113.2:2478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUN relay.example.net:3478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUN example.net")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUNS 203.0.113.2:2478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUNS relay.example.net:3478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUNS example.net")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURN 203.0.113.2:2478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURN relay.example.net:3478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURN example.net")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURNS 203.0.113.2:2478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURNS relay.example.net:3478")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURNS example.net")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURN NONE")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("TURNS NONE")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUN NONE")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("STUNS NONE")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("undefined")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection("null")', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection({}))', true, 'SyntaxError: Unexpected token )');
+test('new webkitPeerConnection(42))', true, 'SyntaxError: Unexpected token )');
+test('new webkitPeerConnection(Infinity)', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection(-Infinity)', true, 'TypeError: Not enough arguments');
+test('new webkitPeerConnection(emptyFunction)', true, 'TypeError: Not enough arguments');
+
+//2 Argument
+test('new webkitPeerConnection("STUN 203.0.113.2:2478",emptyFunction)', false);
+test('new webkitPeerConnection("STUN relay.example.net:3478",emptyFunction)', false);
+test('new webkitPeerConnection("STUN example.net",emptyFunction)',false);
+test('new webkitPeerConnection("STUNS 203.0.113.2:2478",emptyFunction)', false);
+test('new webkitPeerConnection("STUNS relay.example.net:3478",emptyFunction)', false);
+test('new webkitPeerConnection("STUNS example.net",emptyFunction)', false);
+test('new webkitPeerConnection("TURN 203.0.113.2:2478",emptyFunction)', false);
+test('new webkitPeerConnection("TURN relay.example.net:3478",emptyFunction)', false);
+test('new webkitPeerConnection("TURN example.net",emptyFunction)', false);
+test('new webkitPeerConnection("TURNS 203.0.113.2:2478",emptyFunction)', false);
+test('new webkitPeerConnection("TURNS relay.example.net:3478",emptyFunction)', false);
+test('new webkitPeerConnection("TURNS example.net",emptyFunction)', false);
+test('new webkitPeerConnection("TURN NONE",emptyFunction)', false);
+test('new webkitPeerConnection("TURNS NONE",emptyFunction)',false);
+test('new webkitPeerConnection("STUN NONE",emptyFunction)', false);
+test('new webkitPeerConnection("STUNS NONE",emptyFunction)', false);
+test('new webkitPeerConnection("TURN NONE",undefined)',  true);
+test('new webkitPeerConnection("TURNS NONE",{})', false);
+test('new webkitPeerConnection("STUN NONE",42)',  true);
+test('new webkitPeerConnection("STUNS NONE",Infinity)', true);
+test('new webkitPeerConnection("STUNS NONE",-Infinity)', true);
+
+
+
+window.jsTestIsAsync = false;

Modified: trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-addstream.js (108298 => 108299)


--- trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-addstream.js	2012-02-21 05:21:16 UTC (rev 108298)
+++ trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-addstream.js	2012-02-21 05:25:05 UTC (rev 108299)
@@ -25,8 +25,26 @@
 } catch(e) {
     testPassed('pc.addStream(new Array()) threw ' + e);
 }
+try {
+    pc.addStream({});
+} catch(e) {
+    testPassed('pc.addStream({}) threw' + e);
+}
+try {
+    pc.addStream(42);
+} catch(e) {
+    testPassed('pc.addStream(42) threw' + e);
+}
+try {
+    pc.addStream(Infinity);
+} catch(e) {
+    testPassed('pc.addStream(Infinity) threw' + e);
+}
+try {
+    pc.addStream(-Infinity);
+} catch(e) {
+    testPassed('pc.addStream(-Infinity) threw' + e);
+}
 
-finishJSTest();
-
 window.successfullyParsed = true;
 

Added: trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-removestream.js (0 => 108299)


--- trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-removestream.js	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-removestream.js	2012-02-21 05:25:05 UTC (rev 108299)
@@ -0,0 +1,50 @@
+description("Tests PeerConnection::removeStream().");
+
+var pc = new webkitPeerConnection("STUN some.server.com", function() {});
+
+try {
+    pc.removeStream();
+} catch(e) {
+    testPassed('pc.removeStream() threw ' + e);
+}
+
+try {
+    pc.removeStream(undefined);
+} catch(e) {
+    testPassed('pc.removeStream(undefined) threw ' + e);
+}
+
+try {
+    pc.removeStream(null);
+} catch(e) {
+    testPassed('pc.removeStream(null) threw ' + e);
+}
+
+try {
+    pc.removeStream(new Array());
+} catch(e) {
+    testPassed('pc.removeStream(new Array()) threw ' + e);
+}
+try {
+    pc.removeStream({});
+} catch(e) {
+    testPassed('pc.removeStream({}) threw' + e);
+}
+try {
+    pc.removeStream(42);
+} catch(e) {
+    testPassed('pc.removeStream(42) threw' + e);
+}
+try {
+    pc.removeStream(Infinity);
+} catch(e) {
+    testPassed('pc.removeStream(Infinity) threw' + e);
+}
+try {
+    pc.removeStream(-Infinity);
+} catch(e) {
+    testPassed('pc.removeStream(-Infinity) threw' + e);
+}
+
+window.successfullyParsed = true;
+
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to