Changeset 202267 in webkit
- Timestamp:
- Jun 20, 2016 9:51:49 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202264 r202267 1 2016-06-20 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: RTCIceCandidate init dictionary don't handle explicit null or undefined values correctly 4 https://bugs.webkit.org/show_bug.cgi?id=158873 5 6 Reviewed by Alejandro G. Castro. 7 8 Updated test to verify that explicit null and undefined values, passed to the 9 RTCIceCandidate init dictionary, are handled correctly. 10 11 * fast/mediastream/RTCIceCandidate-expected.txt: 12 * fast/mediastream/RTCIceCandidate.html: 13 1 14 2016-06-20 Joseph Pecoraro <pecoraro@apple.com> 2 15 -
trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt
r201350 r202267 25 25 PASS new RTCIceCandidate({sdpMLineIndex:6}); threw exception TypeError: Type error. 26 26 27 One of the 'sdpMid' or 'sdpMLineIndex' members must be present .27 One of the 'sdpMid' or 'sdpMLineIndex' members must be present (and not null or undefined). 28 28 PASS new RTCIceCandidate({candidate:"foo"}); threw exception TypeError: Type error. 29 PASS new RTCIceCandidate({candidate:"foo", sdpMid: null}); threw exception TypeError: Type error. 30 PASS new RTCIceCandidate({candidate:"foo", sdpMid: undefined}); threw exception TypeError: Type error. 31 PASS new RTCIceCandidate({candidate:"foo", sdpMLineIndex: null}); threw exception TypeError: Type error. 32 PASS new RTCIceCandidate({candidate:"foo", sdpMLineIndex: undefined}); threw exception TypeError: Type error. 33 PASS new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: null}); threw exception TypeError: Type error. 34 PASS new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: undefined}); threw exception TypeError: Type error. 35 36 Test that sdpMid or sdpMLineIndex explicitly set to null or undefined, results in a null value. 37 PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: 1}); did not throw exception. 38 PASS candidate.sdpMid is null 39 PASS candidate.sdpMLineIndex is 1 40 PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: 1}); did not throw exception. 41 PASS candidate.sdpMid is null 42 PASS candidate.sdpMLineIndex is 1 43 PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: null}); did not throw exception. 44 PASS candidate.sdpMid is 'foo' 45 PASS candidate.sdpMLineIndex is null 46 PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: undefined}); did not throw exception. 47 PASS candidate.sdpMid is 'foo' 48 PASS candidate.sdpMLineIndex is null 29 49 30 50 When one of the 'sdpMid' or 'sdpMLineIndex' members is set, the other must be null. -
trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html
r201350 r202267 35 35 debug(""); 36 36 37 debug("One of the 'sdpMid' or 'sdpMLineIndex' members must be present .");37 debug("One of the 'sdpMid' or 'sdpMLineIndex' members must be present (and not null or undefined)."); 38 38 shouldThrow('new RTCIceCandidate({candidate:"foo"});'); 39 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid: null});'); 40 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid: undefined});'); 41 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMLineIndex: null});'); 42 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMLineIndex: undefined});'); 43 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: null});'); 44 shouldThrow('new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: undefined});'); 45 debug(""); 46 47 debug("Test that sdpMid or sdpMLineIndex explicitly set to null or undefined, results in a null value."); 48 shouldNotThrow('candidate = new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: 1});'); 49 shouldBeNull("candidate.sdpMid"); 50 shouldBe("candidate.sdpMLineIndex", "1"); 51 52 shouldNotThrow('candidate = new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: 1});'); 53 shouldBeNull("candidate.sdpMid"); 54 shouldBe("candidate.sdpMLineIndex", "1"); 55 56 shouldNotThrow('candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: null});'); 57 shouldBe("candidate.sdpMid", "'foo'"); 58 shouldBeNull("candidate.sdpMLineIndex"); 59 60 shouldNotThrow('candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: undefined});'); 61 shouldBe("candidate.sdpMid", "'foo'"); 62 shouldBeNull("candidate.sdpMLineIndex"); 39 63 debug(""); 40 64 -
trunk/Source/WebCore/ChangeLog
r202265 r202267 1 2016-06-20 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: RTCIceCandidate init dictionary don't handle explicit null or undefined values correctly 4 https://bugs.webkit.org/show_bug.cgi?id=158873 5 6 Reviewed by Alejandro G. Castro. 7 8 Prevent explicit null and undefined values from being converted to "null" and "undefined" 9 strings. 10 11 Test: Extended fast/mediastream/RTCIceCandidate.html 12 13 * Modules/mediastream/RTCIceCandidate.cpp: 14 (WebCore::RTCIceCandidate::create): 15 1 16 2016-06-20 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
r198492 r202267 51 51 52 52 String sdpMid; 53 dictionary.get ("sdpMid", sdpMid);53 dictionary.getWithUndefinedOrNullCheck("sdpMid", sdpMid); 54 54 55 55 Optional<unsigned short> sdpMLineIndex; 56 56 String sdpMLineIndexString; 57 57 58 if (dictionary.get ("sdpMLineIndex", sdpMLineIndexString)) {58 if (dictionary.getWithUndefinedOrNullCheck("sdpMLineIndex", sdpMLineIndexString)) { 59 59 bool intConversionOk; 60 60 unsigned result = sdpMLineIndexString.toUIntStrict(&intConversionOk);
Note: See TracChangeset
for help on using the changeset viewer.