On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS navigator.webkitGetUserMedia() threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia({}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(objectThrowingException) threw exception Error: toString threw exception.
-PASS navigator.webkitGetUserMedia("video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(-Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia(emptyFunction) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS navigator.webkitGetUserMedia() threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(undefined) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(null) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia({}) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(objectThrowingException) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia("video") threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(true) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(42) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.webkitGetUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
PASS navigator.webkitGetUserMedia("video", emptyFunction) did not throw exception.
PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
PASS navigator.webkitGetUserMedia("video", "video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia("video", {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia("video", objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS navigator.webkitGetUserMedia("video", {}) did not throw exception.
+PASS navigator.webkitGetUserMedia("video", objectThrowingException) did not throw exception.
PASS navigator.webkitGetUserMedia("video", true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("audio, video user", emptyFunction, undefined) did not throw exception.
PASS navigator.webkitGetUserMedia("audio, video environment", emptyFunction, undefined) did not throw exception.
PASS navigator.webkitGetUserMedia("video", emptyFunction, "video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia("video", emptyFunction, null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia("video", emptyFunction, {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS navigator.webkitGetUserMedia("video", emptyFunction, null) did not throw exception.
+PASS navigator.webkitGetUserMedia("video", emptyFunction, {}) did not throw exception.
+PASS navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException) did not throw exception.
PASS navigator.webkitGetUserMedia("video", emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.webkitGetUserMedia("video", emptyFunction, Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
if (expectedException)
shouldThrow(expression, '(function() { return "' + expectedException + '"; })();');
else
- shouldThrow(expression, '(function() { return "Error: TYPE_MISMATCH_ERR: DOM Exception 17"; })();');
+ shouldThrow(expression, '(function() { return "TypeError: Not enough arguments"; })();');
} else {
shouldNotThrow(expression);
}
var toStringError = new Error('toString threw exception');
var notSupportedError = new Error('NOT_SUPPORTED_ERR: DOM Exception 9');
+var typeMismatchError = new Error('TYPE_MISMATCH_ERR: DOM Exception 17');
var emptyFunction = function() {};
function ObjectThrowingException() {};
test('navigator.webkitGetUserMedia(undefined)', true);
test('navigator.webkitGetUserMedia(null)', true);
test('navigator.webkitGetUserMedia({})', true);
-test('navigator.webkitGetUserMedia(objectThrowingException)', true, toStringError);
+test('navigator.webkitGetUserMedia(objectThrowingException)', true);
test('navigator.webkitGetUserMedia("video")', true);
test('navigator.webkitGetUserMedia(true)', true);
test('navigator.webkitGetUserMedia(42)', true);
test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', true, notSupportedError);
test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', true, notSupportedError);
-test('navigator.webkitGetUserMedia("video", "video")', true);
-test('navigator.webkitGetUserMedia("video", undefined)', true);
-test('navigator.webkitGetUserMedia("video", null)', true);
-test('navigator.webkitGetUserMedia("video", {})', true);
-test('navigator.webkitGetUserMedia("video", objectThrowingException)', true);
-test('navigator.webkitGetUserMedia("video", true)', true);
-test('navigator.webkitGetUserMedia("video", 42)', true);
-test('navigator.webkitGetUserMedia("video", Infinity)', true);
-test('navigator.webkitGetUserMedia("video", -Infinity)', true);
+test('navigator.webkitGetUserMedia("video", "video")', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", undefined)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", null)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", {})', false);
+test('navigator.webkitGetUserMedia("video", objectThrowingException)', false);
+test('navigator.webkitGetUserMedia("video", true)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", 42)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", Infinity)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", -Infinity)', true, typeMismatchError);
// 3 Arguments.
test('navigator.webkitGetUserMedia("video", emptyFunction, emptyFunction)', false);
test('navigator.webkitGetUserMedia("audio, somethingelse,,video", emptyFunction, undefined)', false);
test('navigator.webkitGetUserMedia("audio, video user", emptyFunction, undefined)', false);
test('navigator.webkitGetUserMedia("audio, video environment", emptyFunction, undefined)', false);
-test('navigator.webkitGetUserMedia("video", emptyFunction, "video")', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, null)', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, {})', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException)', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, true)', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, 42)', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, Infinity)', true);
-test('navigator.webkitGetUserMedia("video", emptyFunction, -Infinity)', true);
+test('navigator.webkitGetUserMedia("video", emptyFunction, "video")', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", emptyFunction, null)', false );
+test('navigator.webkitGetUserMedia("video", emptyFunction, {})', false);
+test('navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException)', false);
+test('navigator.webkitGetUserMedia("video", emptyFunction, true)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", emptyFunction, 42)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", emptyFunction, Infinity)', true, typeMismatchError);
+test('navigator.webkitGetUserMedia("video", emptyFunction, -Infinity)', true, typeMismatchError);
window.jsTestIsAsync = false;