Diff
Modified: trunk/LayoutTests/ChangeLog (116510 => 116511)
--- trunk/LayoutTests/ChangeLog 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/ChangeLog 2012-05-09 10:49:10 UTC (rev 116511)
@@ -1,3 +1,21 @@
+2012-05-09 Tommy Widenflycht <[email protected]>
+
+ MediaStream API: Adding a test for constructed from JS MediaStreams
+ https://bugs.webkit.org/show_bug.cgi?id=85883
+
+ Reviewed by Kent Tamura.
+
+ Also moved shouldNotThrow to js-test-pre, and removed it from all mediastream tests.
+
+ * fast/js/resources/js-test-pre.js:
+ (shouldNotThrow):
+ * fast/mediastream/MediaStreamConstructor-expected.txt: Added.
+ * fast/mediastream/MediaStreamConstructor.html: Added.
+ * fast/mediastream/peerconnection-argument-types-expected.txt:
+ * fast/mediastream/peerconnection-iceoptions.html:
+ * fast/mediastream/script-tests/argument-types.js:
+ * fast/mediastream/script-tests/peerconnection-argument-types.js:
+
2012-05-09 Kent Tamura <[email protected]>
[Chromium] Test expectation update for media-stream tests
Modified: trunk/LayoutTests/fast/js/resources/js-test-pre.js (116510 => 116511)
--- trunk/LayoutTests/fast/js/resources/js-test-pre.js 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/fast/js/resources/js-test-pre.js 2012-05-09 10:49:10 UTC (rev 116511)
@@ -394,6 +394,15 @@
testPassed(_a + " is >= " + _b);
}
+function shouldNotThrow(_a) {
+ try {
+ eval(_a);
+ testPassed(_a + " did not throw exception.");
+ } catch (e) {
+ testFailed(_a + " should not throw exception. Threw exception " + e + ".");
+ }
+}
+
function shouldThrow(_a, _e)
{
var exception;
Added: trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt (0 => 116511)
--- trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt 2012-05-09 10:49:10 UTC (rev 116511)
@@ -0,0 +1,19 @@
+Tests webkitMediaStream.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Got local stream.
+PASS localStream.audioTracks.length is 1
+PASS localStream.videoTracks.length is 1
+PASS typeof webkitMediaStream === 'function' is true
+PASS stream = new webkitMediaStream(localStream.audioTracks, localStream.videoTracks); did not throw exception.
+PASS [object MediaStream] is non-null.
+PASS [object MediaStream] is defined.
+PASS stream.constructor.name is 'MediaStream'
+PASS stream.audioTracks.length is 1
+PASS stream.videoTracks.length is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html (0 => 116511)
--- trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html 2012-05-09 10:49:10 UTC (rev 116511)
@@ -0,0 +1,51 @@
+<!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>
+description("Tests webkitMediaStream.");
+
+function error() {
+ testFailed('Stream generation failed.');
+ finishJSTest();
+}
+
+function getUserMedia(dictionary, callback) {
+ try {
+ navigator.webkitGetUserMedia(dictionary, callback, error);
+ } catch (e) {
+ testFailed('webkitGetUserMedia threw exception :' + e);
+ finishJSTest();
+ }
+}
+
+function gotStream(s) {
+ localStream = s;
+ testPassed('Got local stream.');
+ shouldBe('localStream.audioTracks.length', '1');
+ shouldBe('localStream.videoTracks.length', '1');
+
+ stream = null;
+ shouldBeTrue("typeof webkitMediaStream === 'function'");
+ shouldNotThrow("stream = new webkitMediaStream(localStream.audioTracks, localStream.videoTracks);");
+ shouldBeNonNull(stream);
+ shouldBeDefined(stream);
+ shouldBe("stream.constructor.name", "'MediaStream'");
+ shouldBe('stream.audioTracks.length', '1');
+ shouldBe('stream.videoTracks.length', '1');
+ finishJSTest();
+}
+
+getUserMedia({video:true, audio:true}, gotStream);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt (116510 => 116511)
--- trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt 2012-05-09 10:49:10 UTC (rev 116511)
@@ -3,7 +3,7 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS typeof webkitDeprecatedPeerConnection== 'function' is true
+PASS typeof webkitDeprecatedPeerConnection === 'function' is true
PASS new webkitDeprecatedPeerConnection() threw exception TypeError: Not enough arguments.
PASS new webkitDeprecatedPeerConnection("STUN 203.0.113.2:2478") threw exception TypeError: Not enough arguments.
PASS new webkitDeprecatedPeerConnection("STUN relay.example.net:3478") threw exception TypeError: Not enough arguments.
Modified: trunk/LayoutTests/fast/mediastream/peerconnection-iceoptions.html (116510 => 116511)
--- trunk/LayoutTests/fast/mediastream/peerconnection-iceoptions.html 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/fast/mediastream/peerconnection-iceoptions.html 2012-05-09 10:49:10 UTC (rev 116511)
@@ -11,16 +11,6 @@
<script>
description("Tests PeerConenction00::startIce().");
-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)
Modified: trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (116510 => 116511)
--- trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js 2012-05-09 10:49:10 UTC (rev 116511)
@@ -1,15 +1,5 @@
description("Tests the acceptable types for arguments to navigator.getUserMedia methods.");
-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)
Modified: trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-argument-types.js (116510 => 116511)
--- trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-argument-types.js 2012-05-09 10:01:17 UTC (rev 116510)
+++ trunk/LayoutTests/fast/mediastream/script-tests/peerconnection-argument-types.js 2012-05-09 10:49:10 UTC (rev 116511)
@@ -1,15 +1,5 @@
description("Tests the acceptable types for arguments to method for DeprecatedPeerConnection 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)
@@ -31,7 +21,7 @@
}
var objectThrowingException = new ObjectThrowingException();
-shouldBeTrue("typeof webkitDeprecatedPeerConnection== 'function'");
+shouldBeTrue("typeof webkitDeprecatedPeerConnection === 'function'");
// 0 Argument
test('new webkitDeprecatedPeerConnection()', true,'TypeError: Not enough arguments');