Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt (214532 => 214533)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt 2017-03-29 09:39:41 UTC (rev 214532)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt 2017-03-29 13:34:21 UTC (rev 214533)
@@ -50,7 +50,7 @@
PASS promise pc.setLocalDescription(desc) did not reject with TypeError.
PASS promise pc.setLocalDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
*** desc is not optional
-PASS promise pc.setLocalDescription() rejected with TypeError: Not enough arguments
+FAIL promise pc.setLocalDescription() rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription; expected reason TypeError: Not enough arguments
*** desc is not nullable
PASS promise pc.setLocalDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
@@ -65,7 +65,7 @@
PASS promise pc.setRemoteDescription(desc) did not reject with TypeError.
PASS promise pc.setRemoteDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
*** desc is not optional
-PASS promise pc.setRemoteDescription() rejected with TypeError: Not enough arguments
+FAIL promise pc.setRemoteDescription() rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription; expected reason TypeError: Not enough arguments
*** desc is not nullable
PASS promise pc.setRemoteDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
@@ -79,11 +79,10 @@
*** Test addIceCandidate
PASS promise pc.addIceCandidate(candidate) did not reject with TypeError.
PASS promise pc.addIceCandidate(candidate, emptyFunc, emptyFunc) did not reject with TypeError.
+PASS promise pc.addIceCandidate(null) did not reject with TypeError.
+PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) did not reject with TypeError.
*** candidate is not optional
PASS promise pc.addIceCandidate() rejected with TypeError: Not enough arguments
-*** candidate is not nullable
-PASS promise pc.addIceCandidate(null) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
*** Bad input as candidate
PASS promise pc.addIceCandidate('foo') rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html (214532 => 214533)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html 2017-03-29 09:39:41 UTC (rev 214532)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html 2017-03-29 13:34:21 UTC (rev 214533)
@@ -117,7 +117,7 @@
});
}
- // badInputFull eventually runs badInput
+ // badInputFull checks for void, null, and badInput()
function badInputFull(functionName, firstArg, detailedErrorsArg) {
detailedErrors = detailedErrorsArg;
@@ -144,6 +144,26 @@
});
}
+ // badInputVoid checks for void, and badInput()
+ function badInputVoid(functionName, firstArg, detailedErrorsArg) {
+ detailedErrors = detailedErrorsArg;
+
+ return new Promise(function (resolve) {
+ debug(`*** ${firstArg} is not optional`);
+ promiseShouldReject(`pc.${functionName}()`, "'TypeError: Not enough arguments'")
+ .then(function () {
+ return badInput(functionName, firstArg, detailedErrorsArg);
+ })
+ .then(function () {
+ resolve();
+ })
+ .catch(function (error) {
+ testFailed(`Unexpected error in promise chain: ${error}`);
+ resolve();
+ });
+ });
+ }
+
function badInput(functionName, firstArg, detailedErrorsArg) {
detailedErrors = detailedErrorsArg;
@@ -177,7 +197,13 @@
return promiseShouldNotRejectWithTypeError("pc.addIceCandidate(candidate, emptyFunc, emptyFunc)");
})
.then(function () {
- return badInputFull("addIceCandidate", "candidate", {
+ return promiseShouldNotRejectWithTypeError("pc.addIceCandidate(null)");
+ })
+ .then(function () {
+ return promiseShouldNotRejectWithTypeError("pc.addIceCandidate(null, emptyFunc, emptyFunc)");
+ })
+ .then(function () {
+ return badInputVoid("addIceCandidate", "candidate", {
"arg1": "TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate",
"arg2": "TypeError: Argument 2 ('successCallback') to RTCPeerConnection.addIceCandidate must be a function",
"arg3": "TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.addIceCandidate must be a function"
Deleted: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt (214532 => 214533)
--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt 2017-03-29 09:39:41 UTC (rev 214532)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt 2017-03-29 13:34:21 UTC (rev 214533)
@@ -1,110 +0,0 @@
-Test various arguments to RTCPeerConnection overloaded functions
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception.
-*** Test createOffer
-PASS promise pc.createOffer() did not reject with TypeError.
-PASS promise pc.createOffer(emptyFunc, emptyFunc) did not reject with TypeError.
-PASS promise pc.createOffer(null) did not reject with TypeError.
-PASS promise pc.createOffer(undefined) did not reject with TypeError.
-PASS promise pc.createOffer({}) did not reject with TypeError.
-PASS promise pc.createOffer(emptyFunc, emptyFunc, null) did not reject with TypeError.
-PASS promise pc.createOffer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
-PASS promise pc.createOffer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
-*** Options object must be last
-PASS promise pc.createOffer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
-*** Callbacks are not nullable
-PASS promise pc.createOffer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
-PASS promise pc.createOffer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
-PASS promise pc.createOffer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
-*** Bad input
-PASS promise pc.createOffer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
-PASS promise pc.createOffer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
-PASS promise pc.createOffer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary
-PASS promise pc.createOffer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createOffer must be a dictionary
-
-*** Test createAnswer
-PASS promise pc.createAnswer() did not reject with TypeError.
-PASS promise pc.createAnswer(emptyFunc, emptyFunc) did not reject with TypeError.
-PASS promise pc.createAnswer(null) did not reject with TypeError.
-PASS promise pc.createAnswer(undefined) did not reject with TypeError.
-PASS promise pc.createAnswer({}) did not reject with TypeError.
-PASS promise pc.createAnswer(emptyFunc, emptyFunc, null) did not reject with TypeError.
-PASS promise pc.createAnswer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
-PASS promise pc.createAnswer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
-*** Options object must be last
-PASS promise pc.createAnswer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
-*** Callbacks are not nullable
-PASS promise pc.createAnswer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
-PASS promise pc.createAnswer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
-PASS promise pc.createAnswer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
-*** Bad input
-PASS promise pc.createAnswer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
-PASS promise pc.createAnswer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
-PASS promise pc.createAnswer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createAnswer must be a dictionary
-PASS promise pc.createAnswer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createAnswer must be a dictionary
-
-*** Test setLocalDescription
-PASS promise pc.setLocalDescription(desc) did not reject with TypeError.
-PASS promise pc.setLocalDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
-*** desc is not optional
-PASS promise pc.setLocalDescription() rejected with TypeError: Not enough arguments
-*** desc is not nullable
-PASS promise pc.setLocalDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-PASS promise pc.setLocalDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-*** Bad input as desc
-PASS promise pc.setLocalDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-PASS promise pc.setLocalDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-PASS promise pc.setLocalDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-
-*** Test setRemoteDescription
-PASS promise pc.setRemoteDescription(desc) did not reject with TypeError.
-PASS promise pc.setRemoteDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
-*** desc is not optional
-PASS promise pc.setRemoteDescription() rejected with TypeError: Not enough arguments
-*** desc is not nullable
-PASS promise pc.setRemoteDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-PASS promise pc.setRemoteDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-*** Bad input as desc
-PASS promise pc.setRemoteDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-PASS promise pc.setRemoteDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-PASS promise pc.setRemoteDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-
-*** Test addIceCandidate
-PASS promise pc.addIceCandidate(candidate) did not reject with TypeError.
-PASS promise pc.addIceCandidate(candidate, emptyFunc, emptyFunc) did not reject with TypeError.
-*** candidate is not optional
-PASS promise pc.addIceCandidate() rejected with TypeError: Not enough arguments
-*** candidate is not nullable
-PASS promise pc.addIceCandidate(null) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-*** Bad input as candidate
-PASS promise pc.addIceCandidate('foo') rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-PASS promise pc.addIceCandidate(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
-
-*** Test getStats
-PASS promise pc.getStats() did not reject with TypeError.
-PASS promise pc.getStats(null) did not reject with TypeError.
-PASS promise pc.getStats(selector) did not reject with TypeError.
-PASS promise pc.getStats(null, emptyFunc, emptyFunc) did not reject with TypeError.
-PASS promise pc.getStats(selector, emptyFunc, emptyFunc) did not reject with TypeError.
-PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
-*** Bad input as selector
-PASS promise pc.getStats('foo') rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
-PASS promise pc.getStats('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
-PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
-PASS promise pc.getStats(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-