Changeset 159349 in webkit
- Timestamp:
- Nov 15, 2013 11:34:16 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159348 r159349 1 2013-11-15 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 3 Modifying RTCIceCandidate object construction to match the spec 4 https://bugs.webkit.org/show_bug.cgi?id=124369 5 6 Reviewed by Eric Carlson. 7 8 According to the spec the RTCIceCandidateInit parameter in RTCSessionDescription constructor is optional, 9 which must not be nullable, and, if passed, must be a valid Dictionary. If the keys are not present, the string 10 object that stores them in the RTCIceCandidate class, must be null in those cases. Also, if a key is present 11 and its value is not valid an exception must be raised. 12 13 * fast/mediastream/RTCIceCandidate-expected.txt: 14 * fast/mediastream/RTCIceCandidate.html: 15 1 16 2013-11-15 Tim Horton <timothy_horton@apple.com> 2 17 -
trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt
r134954 r159349 13 13 PASS candidate.sdpMid is "bar" 14 14 PASS candidate.sdpMLineIndex is 6 15 PASS new RTCIceCandidate({}); threw exception Error: TypeMismatchError: DOM Exception 17. 16 PASS new RTCIceCandidate(5); threw exception TypeError: Not an object.. 17 PASS new RTCIceCandidate("foobar"); threw exception TypeError: Not an object.. 18 PASS new RTCIceCandidate(candidate:""); threw exception SyntaxError: Unexpected token :. 19 PASS new RTCIceCandidate({candidate:"x"}); did not throw exception. 15 PASS new RTCIceCandidate({}); did not throw exception. 16 PASS new RTCIceCandidate({candidate:"foo"}); did not throw exception. 17 PASS new RTCIceCandidate({sdpMid:"bar"}); did not throw exception. 18 PASS new RTCIceCandidate({sdpMLineIndex:6}); did not throw exception. 19 PASS new RTCIceCandidate({candidate:"foo", sdpMid:"bar", sdpMLineIndex:"a"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 20 PASS new RTCIceCandidate({sdpMid:"bar", sdpMLineIndex:"a"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 21 PASS new RTCIceCandidate({candidate:"foo", sdpMLineIndex:"a"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 22 PASS new RTCIceCandidate({sdpMLineIndex:"a"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 23 PASS new RTCIceCandidate({candidate:"", sdpMid:"bar", sdpMLineIndex:6}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 24 PASS new RTCIceCandidate({candidate:"", sdpMLineIndex:6}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 25 PASS new RTCIceCandidate({candidate:"", sdpMid:"bar"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 26 PASS new RTCIceCandidate({candidate:""}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 27 PASS new RTCIceCandidate({candidate:"foo", sdpMid:"", sdpMLineIndex:6}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 28 PASS new RTCIceCandidate({sdpMid:"", sdpMLineIndex:6}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 29 PASS new RTCIceCandidate({candidate:"foo", sdpMid:""}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 30 PASS new RTCIceCandidate({sdpMid:""}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 31 PASS new RTCIceCandidate({candidate:"", sdpMid:"", sdpMLineIndex:"a"}); threw exception TypeError: Invalid RTCIceCandidate constructor arguments. 32 PASS new RTCIceCandidate(5); threw exception TypeError: Optional RTCIceCandidate constructor argument must be a valid Dictionary. 33 PASS new RTCIceCandidate("foobar"); threw exception TypeError: Optional RTCIceCandidate constructor argument must be a valid Dictionary. 34 PASS new RTCIceCandidate(candidate:""); threw exception SyntaxError: Unexpected token ':'. Expected ')' to end a argument list.. 20 35 PASS successfullyParsed is true 21 36 -
trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html
r158987 r159349 24 24 shouldBe('candidate.sdpMLineIndex', '6'); 25 25 26 shouldThrow('new RTCIceCandidate({});'); 26 shouldNotThrow('new RTCIceCandidate({});'); 27 shouldNotThrow('new RTCIceCandidate({candidate:"foo"});'); 28 shouldNotThrow('new RTCIceCandidate({sdpMid:"bar"});'); 29 shouldNotThrow('new RTCIceCandidate({sdpMLineIndex:6});'); 30 31 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid:"bar", sdpMLineIndex:"a"});'); 32 shouldThrow('new RTCIceCandidate({sdpMid:"bar", sdpMLineIndex:"a"});'); 33 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMLineIndex:"a"});'); 34 shouldThrow('new RTCIceCandidate({sdpMLineIndex:"a"});'); 35 36 shouldThrow('new RTCIceCandidate({candidate:"", sdpMid:"bar", sdpMLineIndex:6});'); 37 shouldThrow('new RTCIceCandidate({candidate:"", sdpMLineIndex:6});'); 38 shouldThrow('new RTCIceCandidate({candidate:"", sdpMid:"bar"});'); 39 shouldThrow('new RTCIceCandidate({candidate:""});'); 40 41 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid:"", sdpMLineIndex:6});'); 42 shouldThrow('new RTCIceCandidate({sdpMid:"", sdpMLineIndex:6});'); 43 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid:""});'); 44 shouldThrow('new RTCIceCandidate({sdpMid:""});'); 45 46 shouldThrow('new RTCIceCandidate({candidate:"", sdpMid:"", sdpMLineIndex:"a"});'); 47 27 48 shouldThrow('new RTCIceCandidate(5);'); 28 49 shouldThrow('new RTCIceCandidate("foobar");'); 29 50 shouldThrow('new RTCIceCandidate(candidate:"");'); 30 31 shouldNotThrow('new RTCIceCandidate({candidate:"x"});');32 51 33 52 window.successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r159347 r159349 1 2013-11-15 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 3 Modifying RTCIceCandidate object construction to match the spec 4 https://bugs.webkit.org/show_bug.cgi?id=124369 5 6 Reviewed by Eric Carlson. 7 8 According to the spec the RTCIceCandidateInit parameter in RTCSessionDescription constructor is optional, 9 which must not be nullable, and, if passed, must be a valid Dictionary. If the keys are not present, the string 10 object that stores them in the RTCIceCandidate class, must be null in those cases. Also, if a key is present 11 and its value is not valid an exception must be raised. 12 13 Existing test was updated. 14 15 * GNUmakefile.list.am: 16 * Modules/mediastream/RTCIceCandidate.cpp: 17 (WebCore::RTCIceCandidate::create): 18 * Modules/mediastream/RTCIceCandidate.idl: 19 * UseJSC.cmake: 20 * WebCore.vcxproj/WebCore.vcxproj: 21 * WebCore.vcxproj/WebCore.vcxproj.filters: 22 * WebCore.xcodeproj/project.pbxproj: 23 * bindings/js/JSRTCIceCandidateCustom.cpp: Added. 24 (WebCore::JSRTCIceCandidateConstructor::constructJSRTCIceCandidate): 25 1 26 2013-11-15 Commit Queue <commit-queue@webkit.org> 2 27 -
trunk/Source/WebCore/GNUmakefile.list.am
r159335 r159349 2389 2389 Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp \ 2390 2390 Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp \ 2391 Source/WebCore/bindings/js/JSRTCIceCandidateCustom.cpp \ 2391 2392 Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp \ 2392 2393 Source/WebCore/bindings/js/JSRTCSessionDescriptionCustom.cpp \ -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
r134440 r159349 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 46 47 String candidate; 47 48 bool ok = dictionary.get("candidate", candidate); 48 if ( !ok || !candidate.length()) {49 if (ok && candidate.isEmpty()) { 49 50 ec = TYPE_MISMATCH_ERR; 50 51 return 0; … … 52 53 53 54 String sdpMid; 54 dictionary.get("sdpMid", sdpMid); 55 ok = dictionary.get("sdpMid", sdpMid); 56 if (ok && sdpMid.isEmpty()) { 57 ec = TYPE_MISMATCH_ERR; 58 return 0; 59 } 55 60 61 String tempLineIndex; 56 62 unsigned short sdpMLineIndex = 0; 57 dictionary.get("sdpMLineIndex", sdpMLineIndex); 63 // First we check if the property exists in the Dictionary. 64 ok = dictionary.get("sdpMLineIndex", tempLineIndex); 65 // Then we try to convert it to a number and check if it was successful. 66 if (ok) { 67 bool intConversionOk; 68 sdpMLineIndex = tempLineIndex.toUIntStrict(&intConversionOk); 69 if (!intConversionOk) { 70 ec = TYPE_MISMATCH_ERR; 71 return 0; 72 } 73 } 58 74 59 75 return adoptRef(new RTCIceCandidate(RTCIceCandidateDescriptor::create(candidate, sdpMid, sdpMLineIndex))); -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl
r151487 r159349 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 31 32 [ 32 33 Conditional=MEDIA_STREAM, 33 C onstructor(Dictionary dictionary),34 CustomConstructor(optional Dictionary dictionary), 34 35 ConstructorRaisesException 35 36 ] interface RTCIceCandidate { -
trunk/Source/WebCore/UseJSC.cmake
r159230 r159349 244 244 bindings/js/JSMediaSourceStatesCustom.cpp 245 245 bindings/js/JSMediaStreamCapabilitiesCustom.cpp 246 bindings/js/JSRTCIceCandidateCustom.cpp 246 247 bindings/js/JSRTCPeerConnectionCustom.cpp 247 248 bindings/js/JSRTCSessionDescriptionCustom.cpp -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r159270 r159349 16881 16881 </ClCompile> 16882 16882 <ClCompile Include="..\bindings\js\JSSQLTransactionSyncCustom.cpp"> 16883 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 16884 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> 16885 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild> 16886 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild> 16887 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild> 16888 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild> 16889 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> 16890 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> 16891 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild> 16892 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild> 16893 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> 16894 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 16895 </ClCompile> 16896 <ClCompile Include="..\bindings\js\JSRTCIceCandidateCustom.cpp"> 16883 16897 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 16884 16898 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r159270 r159349 4474 4474 <Filter>bindings\js</Filter> 4475 4475 </ClCompile> 4476 <ClCompile Include="..\bindings\js\JSRTCIceCandidateCustom.cpp"> 4477 <Filter>bindings\js</Filter> 4478 </ClCompile> 4476 4479 <ClCompile Include="..\bindings\js\JSRTCPeerConnectionCustom.cpp"> 4477 4480 <Filter>bindings\js</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r159292 r159349 1568 1568 4AD0173C127E82860015035F /* JSHTMLOutputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD0173A127E82860015035F /* JSHTMLOutputElement.cpp */; }; 1569 1569 4AD0173D127E82860015035F /* JSHTMLOutputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AD0173B127E82860015035F /* JSHTMLOutputElement.h */; }; 1570 4AE0BF891836084400F3852D /* JSRTCIceCandidateCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE0BF881836083100F3852D /* JSRTCIceCandidateCustom.cpp */; }; 1570 1571 4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1571 1572 4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2709810AF2E5E00065127F /* PasteboardMac.mm */; }; … … 8260 8261 4AD0173A127E82860015035F /* JSHTMLOutputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOutputElement.cpp; sourceTree = "<group>"; }; 8261 8262 4AD0173B127E82860015035F /* JSHTMLOutputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLOutputElement.h; sourceTree = "<group>"; }; 8263 4AE0BF881836083100F3852D /* JSRTCIceCandidateCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceCandidateCustom.cpp; sourceTree = "<group>"; }; 8262 8264 4B2708C50AF19EE40065127F /* Pasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pasteboard.h; sourceTree = "<group>"; }; 8263 8265 4B2709810AF2E5E00065127F /* PasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardMac.mm; sourceTree = "<group>"; }; … … 19613 19615 isa = PBXGroup; 19614 19616 children = ( 19617 4AE0BF881836083100F3852D /* JSRTCIceCandidateCustom.cpp */, 19615 19618 07D07B131834158800ABDD3C /* JSRTCSessionDescriptionCustom.cpp */, 19616 19619 0705851617FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp */, … … 25875 25878 AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */, 25876 25879 2D46F04E17B96FBD005647F0 /* IntPoint.cpp in Sources */, 25880 4AE0BF891836084400F3852D /* JSRTCIceCandidateCustom.cpp in Sources */, 25877 25881 E47E276816036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp in Sources */, 25878 25882 0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.