Changeset 86055 in webkit
- Timestamp:
- May 9, 2011 7:58:13 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86053 r86055 1 2011-05-09 Leandro Gracia Gil <leandrogracia@chromium.org> 2 3 Reviewed by Tony Gentilcore. 4 5 Media Stream API: add exception raising to the getUserMedia method. 6 https://bugs.webkit.org/show_bug.cgi?id=60387 7 8 Update the expected results for the argument types after the lastest updates 9 in the getUserMedia specification. The test has been disabled temporarily 10 and will be re-enabled by 60177 since some exceptions are risen after parsing 11 the provided options. 12 13 * fast/dom/MediaStream/argument-types-expected.txt: 14 * fast/dom/MediaStream/script-tests/argument-types.js: 15 (ObjectThrowingException.prototype.toString): 16 * platform/chromium/test_expectations.txt: 17 1 18 2011-05-09 Andreas Kling <andreas.kling@nokia.com> 2 19 -
trunk/LayoutTests/fast/dom/MediaStream/argument-types-expected.txt
r83287 r86055 8 8 PASS navigator.webkitGetUserMedia(null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 9 9 PASS navigator.webkitGetUserMedia({}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 10 PASS navigator.webkitGetUserMedia(objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.10 PASS navigator.webkitGetUserMedia(objectThrowingException) threw exception Error: toString threw exception. 11 11 PASS navigator.webkitGetUserMedia("video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 12 12 PASS navigator.webkitGetUserMedia(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. … … 16 16 PASS navigator.webkitGetUserMedia(emptyFunction) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 17 17 PASS navigator.webkitGetUserMedia("video", emptyFunction) did not throw exception. 18 PASS navigator.webkitGetUserMedia(undefined, emptyFunction) did not throw exception.19 PASS navigator.webkitGetUserMedia(null, emptyFunction) did not throw exception.20 PASS navigator.webkitGetUserMedia({}, emptyFunction) did not throw exception.18 PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 19 PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 20 PASS navigator.webkitGetUserMedia({}, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 21 21 PASS navigator.webkitGetUserMedia(objectThrowingException, emptyFunction) threw exception Error: toString threw exception. 22 PASS navigator.webkitGetUserMedia(true, emptyFunction) did not throw exception.23 PASS navigator.webkitGetUserMedia(42, emptyFunction) did not throw exception.24 PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) did not throw exception.25 PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) did not throw exception.26 PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) did not throw exception.22 PASS navigator.webkitGetUserMedia(true, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 23 PASS navigator.webkitGetUserMedia(42, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 24 PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 25 PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 26 PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 27 27 PASS navigator.webkitGetUserMedia("video", "video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 28 28 PASS navigator.webkitGetUserMedia("video", undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. … … 36 36 PASS navigator.webkitGetUserMedia("video", emptyFunction, emptyFunction) did not throw exception. 37 37 PASS navigator.webkitGetUserMedia("video", emptyFunction, undefined) did not throw exception. 38 PASS navigator.webkitGetUserMedia("audio, video", emptyFunction, undefined) did not throw exception. 39 PASS navigator.webkitGetUserMedia("audio, somethingelse,,video", emptyFunction, undefined) did not throw exception. 40 PASS navigator.webkitGetUserMedia("audio, video user", emptyFunction, undefined) did not throw exception. 41 PASS navigator.webkitGetUserMedia("audio, video environment", emptyFunction, undefined) did not throw exception. 38 42 PASS navigator.webkitGetUserMedia("video", emptyFunction, "video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 39 43 PASS navigator.webkitGetUserMedia("video", emptyFunction, null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. -
trunk/LayoutTests/fast/dom/MediaStream/script-tests/argument-types.js
r83287 r86055 22 22 } 23 23 24 var toStringError = new Error('toString threw exception'); 25 var notSupportedError = new Error('NOT_SUPPORTED_ERR: DOM Exception 9'); 24 26 var emptyFunction = function() {}; 25 27 26 28 function ObjectThrowingException() {}; 27 ObjectThrowingException.prototype.valueOf = function() {28 throw new Error('valueOf threw exception');29 }30 29 ObjectThrowingException.prototype.toString = function() { 31 throw new Error('toString threw exception');30 throw toStringError; 32 31 } 33 32 var objectThrowingException = new ObjectThrowingException(); … … 40 39 test('navigator.webkitGetUserMedia(null)', true); 41 40 test('navigator.webkitGetUserMedia({})', true); 42 test('navigator.webkitGetUserMedia(objectThrowingException)', true );41 test('navigator.webkitGetUserMedia(objectThrowingException)', true, toStringError); 43 42 test('navigator.webkitGetUserMedia("video")', true); 44 43 test('navigator.webkitGetUserMedia(true)', true); … … 50 49 // 2 Arguments. 51 50 test('navigator.webkitGetUserMedia("video", emptyFunction)', false); 52 test('navigator.webkitGetUserMedia(undefined, emptyFunction)', false);53 test('navigator.webkitGetUserMedia(null, emptyFunction)', false);54 test('navigator.webkitGetUserMedia({}, emptyFunction)', false);55 test('navigator.webkitGetUserMedia(objectThrowingException, emptyFunction)', true, new Error('toString threw exception'));56 test('navigator.webkitGetUserMedia(true, emptyFunction)', false);57 test('navigator.webkitGetUserMedia(42, emptyFunction)', false);58 test('navigator.webkitGetUserMedia(Infinity, emptyFunction)', false);59 test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', false);60 test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', false);51 test('navigator.webkitGetUserMedia(undefined, emptyFunction)', true, notSupportedError); 52 test('navigator.webkitGetUserMedia(null, emptyFunction)', true, notSupportedError); 53 test('navigator.webkitGetUserMedia({}, emptyFunction)', true, notSupportedError); 54 test('navigator.webkitGetUserMedia(objectThrowingException, emptyFunction)', true, toStringError); 55 test('navigator.webkitGetUserMedia(true, emptyFunction)', true, notSupportedError); 56 test('navigator.webkitGetUserMedia(42, emptyFunction)', true, notSupportedError); 57 test('navigator.webkitGetUserMedia(Infinity, emptyFunction)', true, notSupportedError); 58 test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', true, notSupportedError); 59 test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', true, notSupportedError); 61 60 62 61 test('navigator.webkitGetUserMedia("video", "video")', true); … … 73 72 test('navigator.webkitGetUserMedia("video", emptyFunction, emptyFunction)', false); 74 73 test('navigator.webkitGetUserMedia("video", emptyFunction, undefined)', false); 74 test('navigator.webkitGetUserMedia("audio, video", emptyFunction, undefined)', false); 75 test('navigator.webkitGetUserMedia("audio, somethingelse,,video", emptyFunction, undefined)', false); 76 test('navigator.webkitGetUserMedia("audio, video user", emptyFunction, undefined)', false); 77 test('navigator.webkitGetUserMedia("audio, video environment", emptyFunction, undefined)', false); 75 78 test('navigator.webkitGetUserMedia("video", emptyFunction, "video")', true); 76 79 test('navigator.webkitGetUserMedia("video", emptyFunction, null)', true); -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r86047 r86055 4046 4046 BUGWK54181 : fast/events/page-visibility-iframe-propagation-test.html = TIMEOUT 4047 4047 BUGWK54181 : fast/events/page-visibility-transition-test.html = TIMEOUT 4048 4049 // To be re-enabled after landing https://bugs.webkit.org/show_bug.cgi?id=60177. 4050 BUGWK60387 : fast/dom/MediaStream/argument-types.html = FAIL -
trunk/Source/WebCore/ChangeLog
r86054 r86055 1 2011-05-09 Leandro Gracia Gil <leandrogracia@chromium.org> 2 3 Reviewed by Tony Gentilcore. 4 5 Media Stream API: add exception raising to the getUserMedia method. 6 https://bugs.webkit.org/show_bug.cgi?id=60387 7 8 Perform the required changes to support rising exceptions in the 9 navigator.getUserMedia method. This is required by the latest changes in the spec: 10 http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dom-navigator-getusermedia 11 12 Test: fast/dom/MediaStream/argument-types.html 13 14 * bindings/js/JSNavigatorCustom.cpp: 15 (WebCore::JSNavigator::webkitGetUserMedia): 16 * bindings/v8/custom/V8NavigatorCustom.cpp: 17 (WebCore::V8Navigator::webkitGetUserMediaCallback): 18 * page/Navigator.cpp: 19 (WebCore::Navigator::webkitGetUserMedia): 20 * page/Navigator.h: 21 * page/Navigator.idl: 22 1 23 2011-05-09 Csaba Osztrogonác <ossy@webkit.org> 2 24 -
trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp
r84736 r86055 25 25 26 26 #include "CallbackFunction.h" 27 #include "ExceptionCode.h" 27 28 #include "JSNavigatorUserMediaErrorCallback.h" 28 29 #include "JSNavigatorUserMediaSuccessCallback.h" … … 50 51 return jsUndefined(); 51 52 52 m_impl->webkitGetUserMedia(options, successCallback.release(), errorCallback.release()); 53 ExceptionCode ec; 54 m_impl->webkitGetUserMedia(options, successCallback.release(), errorCallback.release(), ec); 55 56 if (ec) 57 setDOMException(exec, ec); 58 53 59 return jsUndefined(); 54 60 } -
trunk/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
r83287 r86055 28 28 #if ENABLE(MEDIA_STREAM) 29 29 30 #include "ExceptionCode.h" 30 31 #include "Navigator.h" 31 32 #include "V8Binding.h" … … 43 44 44 45 v8::TryCatch exceptionCatcher; 45 String options = toWebCoreString(args[0]);46 v8::Handle<v8::String> options = args[0]->ToString(); 46 47 if (exceptionCatcher.HasCaught()) 47 48 return throwError(exceptionCatcher.Exception()); 48 49 49 50 bool succeeded = false; 50 51 51 RefPtr<NavigatorUserMediaSuccessCallback> successCallback = createFunctionOnlyCallback<V8NavigatorUserMediaSuccessCallback>(args[1], succeeded); 52 52 if (!succeeded) … … 58 58 return v8::Undefined(); 59 59 60 ExceptionCode ec = 0; 60 61 Navigator* navigator = V8Navigator::toNative(args.Holder()); 61 navigator->webkitGetUserMedia( options, successCallback.release(), errorCallback.release());62 return v8::Undefined();62 navigator->webkitGetUserMedia(toWebCoreString(options), successCallback.release(), errorCallback.release(), ec); 63 return throwError(ec); 63 64 } 64 65 -
trunk/Source/WebCore/page/Navigator.cpp
r85030 r86055 246 246 247 247 #if ENABLE(MEDIA_STREAM) 248 void Navigator::webkitGetUserMedia(const String& options, 249 PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, 250 PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback) 248 void Navigator::webkitGetUserMedia(const String&, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&) 251 249 { 252 250 // FIXME: implement a call to the media stream context when available. -
trunk/Source/WebCore/page/Navigator.h
r84736 r86055 69 69 70 70 #if ENABLE(MEDIA_STREAM) 71 virtual void webkitGetUserMedia(const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, 72 PassRefPtr<NavigatorUserMediaErrorCallback> = 0); 71 virtual void webkitGetUserMedia(const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&); 73 72 #endif 74 73 -
trunk/Source/WebCore/page/Navigator.idl
r84764 r86055 57 57 [Custom, EnabledAtRuntime] void webkitGetUserMedia(in DOMString options, 58 58 in [Callback=FunctionOnly] NavigatorUserMediaSuccessCallback successCallback, 59 in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback); 59 in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback) 60 raises(DOMException); 60 61 #endif 61 62 };
Note: See TracChangeset
for help on using the changeset viewer.