Changeset 185820 in webkit
- Timestamp:
- Jun 22, 2015 1:36:38 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r185815 r185820 1 2015-06-22 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Navigator.webkitGetUserMedia() requires three arguments 4 https://bugs.webkit.org/show_bug.cgi?id=146022 5 6 Reviewed by Eric Carlson. 7 8 Updated and unskipped three existing tests. 9 10 * fast/mediastream/argument-types-expected.txt: 11 * fast/mediastream/getusermedia-expected.txt: 12 * fast/mediastream/getusermedia.html: 13 * fast/mediastream/script-tests/argument-types.js: 14 * platform/gtk/TestExpectations: 15 1 16 2015-06-21 David Kilzer <ddkilzer@apple.com> 2 17 -
trunk/LayoutTests/fast/mediastream/argument-types-expected.txt
r165915 r185820 14 14 PASS navigator.webkitGetUserMedia(-Infinity) threw exception TypeError: Not enough arguments. 15 15 PASS navigator.webkitGetUserMedia(emptyFunction) threw exception TypeError: Not enough arguments. 16 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction) did not throw exception.17 PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.18 PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.19 PASS navigator.webkitGetUserMedia({ }, emptyFunction) threw exception Error: NotSupportedError: DOM Exception 9.20 PASS navigator.webkitGetUserMedia(true, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.21 PASS navigator.webkitGetUserMedia(42, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.22 PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.23 PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) threw exception TypeError: First argument of webkitGetUserMedia must be a valid Dictionary.24 PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) threw exception Error: NotSupportedError: DOM Exception 9.25 PASS navigator.webkitGetUserMedia({video: true}, "foobar") threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.26 PASS navigator.webkitGetUserMedia({video: true}, undefined) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.27 PASS navigator.webkitGetUserMedia({video: true}, null) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.28 PASS navigator.webkitGetUserMedia({video: true}, {}) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.29 PASS navigator.webkitGetUserMedia({video: true}, true) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.30 PASS navigator.webkitGetUserMedia({video: true}, 42) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.31 PASS navigator.webkitGetUserMedia({video: true}, Infinity) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.32 PASS navigator.webkitGetUserMedia({video: true}, -Infinity) threw exception TypeError: Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function.16 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments. 17 PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments. 18 PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments. 19 PASS navigator.webkitGetUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments. 20 PASS navigator.webkitGetUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments. 21 PASS navigator.webkitGetUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments. 22 PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments. 23 PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments. 24 PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments. 25 PASS navigator.webkitGetUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments. 26 PASS navigator.webkitGetUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments. 27 PASS navigator.webkitGetUserMedia({video: true}, null) threw exception TypeError: Not enough arguments. 28 PASS navigator.webkitGetUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments. 29 PASS navigator.webkitGetUserMedia({video: true}, true) threw exception TypeError: Not enough arguments. 30 PASS navigator.webkitGetUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments. 31 PASS navigator.webkitGetUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments. 32 PASS navigator.webkitGetUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments. 33 33 PASS navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction) threw exception Error: NotSupportedError: DOM Exception 9. 34 34 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception. 35 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) did not throw exception.36 PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) did not throw exception.37 PASS navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined) did not throw exception.35 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 36 PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 37 PASS navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 38 38 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 39 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) did not throw exception.39 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 40 40 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 41 41 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. -
trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt
r156108 r185820 5 5 6 6 PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, error); threw exception Error: NotSupportedError: DOM Exception 9. 7 PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 7 8 PASS navigator.webkitGetUserMedia({audio:true}, gotStream1, error); did not throw exception. 8 9 PASS Stream generated. 9 10 PASS stream.getAudioTracks().length is 1 10 11 PASS stream.getVideoTracks().length is 0 12 PASS navigator.webkitGetUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 11 13 PASS navigator.webkitGetUserMedia({video:true}, gotStream2, error); did not throw exception. 12 14 PASS Stream generated. 13 15 PASS stream.getAudioTracks().length is 0 14 16 PASS stream.getVideoTracks().length is 1 17 PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 15 18 PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception. 16 19 PASS Stream generated. 17 20 PASS stream.getAudioTracks().length is 1 18 21 PASS stream.getVideoTracks().length is 1 22 PASS navigator.webkitGetUserMedia({audio:{mandatory:{}, optional:[]}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 19 23 PASS navigator.webkitGetUserMedia({audio:{mandatory:{}, optional:[]}, video:true}, gotStream4, error); did not throw exception. 20 24 PASS Stream generated. 21 25 PASS stream.getAudioTracks().length is 1 22 26 PASS stream.getVideoTracks().length is 1 27 PASS navigator.webkitGetUserMedia({audio:{mandatory:{'valid_but_unsupported_1':0}, optional:[]}, video:true}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 23 28 PASS navigator.webkitGetUserMedia({audio:{mandatory:{'valid_but_unsupported_1':0}, optional:[]}, video:true}, gotStreamInError, error1); did not throw exception. 24 29 PASS Error callback called. 25 30 PASS errorArg.name is "ConstraintNotSatisfiedError" 26 31 PASS errorArg.constraintName is "valid_but_unsupported_1" 32 PASS navigator.webkitGetUserMedia({audio:{mandatory:{'valid_and_supported_1':1}, optional:[{'valid_but_unsupported_1':0}]}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function. 27 33 PASS navigator.webkitGetUserMedia({audio:{mandatory:{'valid_and_supported_1':1}, optional:[{'valid_but_unsupported_1':0}]}, video:true}, gotStream5, error); did not throw exception. 28 34 PASS Stream generated. -
trunk/LayoutTests/fast/mediastream/getusermedia.html
r168842 r185820 9 9 <script> 10 10 description("Tests webkitGetUserMedia."); 11 12 function setUserMediaPermission(isGranted) { 13 if (window.testRunner) 14 testRunner.setUserMediaPermission(isGranted); 15 else 16 debug("This test can not be run without the testRunner"); 17 } 11 18 12 19 var stream; … … 83 90 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, error);") 84 91 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, null);") 92 93 setUserMediaPermission(true); 85 94 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);"); 86 95 -
trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js
r165915 r185820 24 24 test('navigator.webkitGetUserMedia()', true); 25 25 26 // 1 Argument ( getUserMedia requires at least 2arguments).26 // 1 Argument (Navigtor.webkitGetUserMedia requires at least 3 arguments). 27 27 test('navigator.webkitGetUserMedia(undefined)', true); 28 28 test('navigator.webkitGetUserMedia(null)', true); … … 36 36 37 37 // 2 Arguments. 38 test('navigator.webkitGetUserMedia({video: true}, emptyFunction)', false);39 test('navigator.webkitGetUserMedia(undefined, emptyFunction)', true , invalidDictionaryError);40 test('navigator.webkitGetUserMedia(null, emptyFunction)', true , invalidDictionaryError);41 test('navigator.webkitGetUserMedia({ }, emptyFunction)', true , notSupportedError);42 test('navigator.webkitGetUserMedia(true, emptyFunction)', true , invalidDictionaryError);43 test('navigator.webkitGetUserMedia(42, emptyFunction)', true , invalidDictionaryError);44 test('navigator.webkitGetUserMedia(Infinity, emptyFunction)', true , invalidDictionaryError);45 test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', true , invalidDictionaryError);46 test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', true , notSupportedError);47 test('navigator.webkitGetUserMedia({video: true}, "foobar")', true , successCallbackError);48 test('navigator.webkitGetUserMedia({video: true}, undefined)', true , successCallbackError);49 test('navigator.webkitGetUserMedia({video: true}, null)', true , successCallbackError);50 test('navigator.webkitGetUserMedia({video: true}, {})', true , successCallbackError);51 test('navigator.webkitGetUserMedia({video: true}, true)', true , successCallbackError);52 test('navigator.webkitGetUserMedia({video: true}, 42)', true , successCallbackError);53 test('navigator.webkitGetUserMedia({video: true}, Infinity)', true , successCallbackError);54 test('navigator.webkitGetUserMedia({video: true}, -Infinity)', true , successCallbackError);38 test('navigator.webkitGetUserMedia({video: true}, emptyFunction)', true); 39 test('navigator.webkitGetUserMedia(undefined, emptyFunction)', true); 40 test('navigator.webkitGetUserMedia(null, emptyFunction)', true); 41 test('navigator.webkitGetUserMedia({ }, emptyFunction)', true); 42 test('navigator.webkitGetUserMedia(true, emptyFunction)', true); 43 test('navigator.webkitGetUserMedia(42, emptyFunction)', true); 44 test('navigator.webkitGetUserMedia(Infinity, emptyFunction)', true); 45 test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', true); 46 test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', true); 47 test('navigator.webkitGetUserMedia({video: true}, "foobar")', true); 48 test('navigator.webkitGetUserMedia({video: true}, undefined)', true); 49 test('navigator.webkitGetUserMedia({video: true}, null)', true); 50 test('navigator.webkitGetUserMedia({video: true}, {})', true); 51 test('navigator.webkitGetUserMedia({video: true}, true)', true); 52 test('navigator.webkitGetUserMedia({video: true}, 42)', true); 53 test('navigator.webkitGetUserMedia({video: true}, Infinity)', true); 54 test('navigator.webkitGetUserMedia({video: true}, -Infinity)', true); 55 55 56 56 // 3 Arguments. 57 57 test('navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction)', true, notSupportedError); 58 58 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, emptyFunction)', false); 59 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined)', false);60 test('navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined)', false);61 test('navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined)', false);59 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined)', true, errorCallbackError); 60 test('navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined)', true, errorCallbackError); 61 test('navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined)', true, errorCallbackError); 62 62 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, "video")', true, errorCallbackError); 63 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, null)', false);63 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, null)', true, errorCallbackError ); 64 64 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, {})', true, errorCallbackError); 65 65 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, true)', true, errorCallbackError); -
trunk/LayoutTests/platform/gtk/TestExpectations
r185402 r185820 315 315 316 316 # Mediastream implementation is not complete yet. 317 webkit.org/b/79203 fast/mediastream/argument-types.html [ Skip ]318 webkit.org/b/79203 fast/mediastream/getusermedia.html [ Skip ]319 317 webkit.org/b/79203 fast/mediastream/MediaStream-add-ended-tracks.html [ Skip ] 320 318 webkit.org/b/79203 fast/mediastream/MediaStream-add-remove-tracks.html [ Skip ] … … 329 327 webkit.org/b/79203 fast/mediastream/MediaStreamTrack.html [ Skip ] 330 328 webkit.org/b/79203 fast/mediastream/MediaStreamTrack-onended.html [ Skip ] 331 webkit.org/b/79203 fast/mediastream/no-interface-object.html [ Skip ]332 329 webkit.org/b/79203 fast/mediastream/RTCIceCandidate.html [ Skip ] 333 330 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-AddRemoveStream.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r185819 r185820 1 2015-06-22 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Navigator.webkitGetUserMedia() requires three arguments 4 https://bugs.webkit.org/show_bug.cgi?id=146022 5 6 Reviewed by Eric Carlson. 7 8 Updated custom binding to make the third error callback argument 9 mandatory. Updated and unskipped three tests (for the GTK+ port). 10 11 * bindings/js/JSNavigatorCustom.cpp: 12 (WebCore::JSNavigator::webkitGetUserMedia): 13 1 14 2015-06-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 15 -
trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp
r168576 r185820 41 41 JSValue JSNavigator::webkitGetUserMedia(ExecState* exec) 42 42 { 43 if (exec->argumentCount() < 2) {43 if (exec->argumentCount() < 3) { 44 44 throwVMError(exec, createNotEnoughArgumentsError(exec)); 45 45 return jsUndefined(); … … 60 60 } 61 61 62 JSNavigator* castedThis = jsDynamicCast<JSNavigator*>(exec->thisValue()); 63 RefPtr<NavigatorUserMediaErrorCallback> errorCallback; 64 if (!exec->argument(2).isUndefinedOrNull()) { 65 if (!exec->uncheckedArgument(2).isFunction()) { 66 throwVMTypeError(exec, "Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function"); 67 return jsUndefined(); 68 } 69 errorCallback = JSNavigatorUserMediaErrorCallback::create(asObject(exec->uncheckedArgument(2)), castedThis->globalObject()); 62 if (!exec->argument(2).isFunction()) { 63 throwVMTypeError(exec, "Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function"); 64 return jsUndefined(); 70 65 } 71 66 72 RefPtr<NavigatorUserMediaSuccessCallback> successCallback = JSNavigatorUserMediaSuccessCallback::create(asObject(exec->uncheckedArgument(1)), castedThis->globalObject()); 73 Navigator& impl = castedThis->impl(); 67 RefPtr<NavigatorUserMediaSuccessCallback> successCallback = JSNavigatorUserMediaSuccessCallback::create(asObject(exec->uncheckedArgument(1)), globalObject()); 68 RefPtr<NavigatorUserMediaErrorCallback> errorCallback = JSNavigatorUserMediaErrorCallback::create(asObject(exec->uncheckedArgument(2)), globalObject()); 69 74 70 ExceptionCode ec = 0; 75 NavigatorUserMedia::webkitGetUserMedia(&impl , options, successCallback, errorCallback, ec);71 NavigatorUserMedia::webkitGetUserMedia(&impl(), options, successCallback, errorCallback, ec); 76 72 setDOMException(exec, ec); 77 73 return jsUndefined();
Note: See TracChangeset
for help on using the changeset viewer.