diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/media/tests/mochitest/identity/identityPcTest.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/tests/mochitest/identity/identityPcTest.js')
-rw-r--r-- | dom/media/tests/mochitest/identity/identityPcTest.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/dom/media/tests/mochitest/identity/identityPcTest.js b/dom/media/tests/mochitest/identity/identityPcTest.js new file mode 100644 index 000000000..e5fcbc5db --- /dev/null +++ b/dom/media/tests/mochitest/identity/identityPcTest.js @@ -0,0 +1,53 @@ +function identityPcTest(remoteOptions) { + var user = 'someone'; + var domain1 = 'test1.example.com'; + var domain2 = 'test2.example.com'; + var id1 = user + '@' + domain1; + var id2 = user + '@' + domain2; + + test = new PeerConnectionTest({ + config_local: { + peerIdentity: id2 + }, + config_remote: { + peerIdentity: id1 + } + }); + test.setMediaConstraints([{ + audio: true, + video: true, + peerIdentity: id2 + }], [remoteOptions || { + audio: true, + video: true, + peerIdentity: id1 + }]); + test.pcLocal.setIdentityProvider('test1.example.com', 'idp.js'); + test.pcRemote.setIdentityProvider('test2.example.com', 'idp.js'); + test.chain.append([ + function PEER_IDENTITY_IS_SET_CORRECTLY(test) { + // no need to wait to check identity in this case, + // setRemoteDescription should wait for the IdP to complete + function checkIdentity(pc, pfx, idp, name) { + return pc.peerIdentity.then(peerInfo => { + is(peerInfo.idp, idp, pfx + "IdP check"); + is(peerInfo.name, name + "@" + idp, pfx + "identity check"); + }); + } + + return Promise.all([ + checkIdentity(test.pcLocal._pc, "local: ", "test2.example.com", "someone"), + checkIdentity(test.pcRemote._pc, "remote: ", "test1.example.com", "someone") + ]); + }, + + function REMOTE_STREAMS_ARE_RESTRICTED(test) { + var remoteStream = test.pcLocal._pc.getRemoteStreams()[0]; + return Promise.all([ + audioIsSilence(true, remoteStream), + videoIsBlack(true, remoteStream) + ]); + } + ]); + test.run(); +} |