Backed out 3 changesets (bug 1446880) for mochitest failures on test_exceptions_from_jsimplemented.htm CLOSED TREE

Backed out changeset 3d162d7e2721 (bug 1446880)
Backed out changeset 7142d472f2a4 (bug 1446880)
Backed out changeset 50c255c237f1 (bug 1446880)
This commit is contained in:
Brindusan Cristian 2018-04-04 20:48:59 +03:00
Родитель c151b3a76d
Коммит 88cd740311
15 изменённых файлов: 33 добавлений и 69 удалений

Просмотреть файл

@ -1062,11 +1062,9 @@ class RTCPeerConnection {
});
}
setIdentityProvider(provider,
{protocol, usernameHint, peerIdentity} = {}) {
setIdentityProvider(provider, protocol, username) {
this._checkClosed();
this._localIdp.setIdentityProvider(provider,
protocol, usernameHint, peerIdentity);
this._localIdp.setIdentityProvider(provider, protocol, username);
}
async _getIdentityAssertion(origin) {

Просмотреть файл

@ -43,12 +43,11 @@ PeerConnectionIdp.prototype = {
this.idpLoginUrl = null;
},
setIdentityProvider(provider, protocol, usernameHint, peerIdentity) {
setIdentityProvider(provider, protocol, username) {
this._resetAssertion();
this.provider = provider;
this.protocol = protocol;
this.username = usernameHint;
this.peeridentity = peerIdentity;
this.protocol = protocol || "default";
this.username = username;
if (this._idp) {
if (this._idp.isSame(provider, protocol)) {
return; // noop
@ -70,8 +69,6 @@ PeerConnectionIdp.prototype = {
this._resetAssertion();
this.provider = null;
this.protocol = null;
this.username = null;
this.peeridentity = null;
if (this._idp) {
this._idp.stop();
this._idp = null;
@ -285,15 +282,9 @@ PeerConnectionIdp.prototype = {
this._resetAssertion();
let p = this.start()
.then(idp => {
let options = { protocol: this.protocol,
usernameHint: this.username,
peerIdentity: this.peeridentity };
return this._wrapCrossCompartmentPromise(
idp.generateAssertion(JSON.stringify(content),
origin,
options));
})
.then(idp => this._wrapCrossCompartmentPromise(
idp.generateAssertion(JSON.stringify(content),
origin, this.username)))
.then(assertion => {
if (!this._isValidAssertion(assertion)) {
throw new this._win.DOMException("IdP generated invalid assertion",

Просмотреть файл

@ -22,8 +22,8 @@ function identityPcTest(remoteOptions) {
video: true,
peerIdentity: id1
}]);
test.pcLocal.setIdentityProvider('test1.example.com', { protocol: 'idp.js' });
test.pcRemote.setIdentityProvider('test2.example.com', { protocol: 'idp.js' });
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,

Просмотреть файл

@ -56,7 +56,6 @@
},
_selectUsername: function(usernameHint) {
dump('_selectUsername: usernameHint(' + usernameHint + ')\n');
var username = 'someone@' + this.domain;
if (usernameHint) {
var at = usernameHint.indexOf('@');
@ -69,9 +68,8 @@
return username;
},
generateAssertion: function(payload, origin, options) {
dump('idp: generateAssertion(' + payload + ', ' + origin + ', '
+ JSON.stringify(options) + ')\n');
generateAssertion: function(payload, origin, usernameHint) {
dump('idp: generateAssertion(' + payload + ')\n');
var idpDetails = {
domain: this.domain,
protocol: this.protocol
@ -82,7 +80,7 @@
return this.borkResult({
idp: idpDetails,
assertion: JSON.stringify({
username: this._selectUsername(options.usernameHint),
username: this._selectUsername(usernameHint),
contents: payload
})
});

Просмотреть файл

@ -16,8 +16,7 @@ function getIdentityAssertion(fpArray) {
return sandbox.start()
.then(idp => SpecialPowers.wrap(idp)
.generateAssertion(JSON.stringify({ fingerprint: fpArray }),
'https://example.com',
{}))
'https://example.com'))
.then(assertion => {
assertion = SpecialPowers.wrap(assertion);
var assertionString = btoa(JSON.stringify(assertion));

Просмотреть файл

@ -21,11 +21,8 @@ function checkIdentity(assertion, identity) {
}
function getAssertion(t, instructions, userHint) {
dump('instructions: ' + instructions + '\n');
dump('userHint: ' + userHint + '\n');
t.pcLocal.setIdentityProvider('example.com',
{ protocol: 'idp.js' + instructions,
usernameHint: userHint });
t.pcLocal.setIdentityProvider('example.com', 'idp.js' + instructions,
userHint);
return t.pcLocal._pc.getIdentityAssertion();
}
@ -42,9 +39,7 @@ function theTest() {
},
function PC_LOCAL_IDENTITY_ASSERTION_FAILS_WITH_BAD_PROVIDER(t) {
t.pcLocal._pc.setIdentityProvider('example.com',
{ protocol: 'idp-bad.js',
usernameHint: '' });
t.pcLocal._pc.setIdentityProvider('example.com', 'idp-bad.js', '');
return t.pcLocal._pc.getIdentityAssertion()
.then(a => ok(false, 'should fail with bad provider'),
e => {

Просмотреть файл

@ -63,8 +63,7 @@ function makeSandbox(js) {
function test_generate_assertion() {
return makeSandbox()
.then(idp => idp.generateAssertion(dummyPayload,
'https://example.net',
{}))
'https://example.net'))
.then(response => {
response = SpecialPowers.wrap(response);
is(response.idp.domain, 'example.com', 'domain is correct');
@ -80,8 +79,7 @@ function test_generate_assertion() {
function test_validate_assertion() {
return makeSandbox()
.then(idp => idp.generateAssertion(dummyPayload,
'https://example.net',
{ usernameHint: 'user' }))
'https://example.net', 'user'))
.then(assertion => {
var wrapped = SpecialPowers.wrap(assertion);
return makeSandbox()
@ -99,7 +97,7 @@ function test_validate_assertion() {
function test_assertion_failure(reason) {
return () => {
return makeSandbox(idpName(reason))
.then(idp => idp.generateAssertion('hello', 'example.net', {}))
.then(idp => idp.generateAssertion('hello', 'example.net'))
.then(r => ok(false, 'should not succeed on ' + reason),
e => ok(true, 'failed correctly on ' + reason));
};

Просмотреть файл

@ -24,8 +24,7 @@ function waitForLoginDone() {
}
function checkLogin(t, name, onLoginNeeded) {
t.pcLocal.setIdentityProvider('example.com',
{ protocol: 'idp.js#login:' + name });
t.pcLocal.setIdentityProvider('example.com', 'idp.js#login:' + name);
return t.pcLocal._pc.getIdentityAssertion()
.then(a => ok(false, 'should request login'),
e => {

Просмотреть файл

@ -24,12 +24,8 @@ function checkIdentity(peer, prefix, idp, name) {
function theTest() {
var test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.pcLocal.setIdentityProvider("test1.example.com",
{ protocol: "idp.js",
usernameHint: "someone" });
test.pcRemote.setIdentityProvider("test2.example.com",
{ protocol: "idp.js",
usernameHinte: "someone"});
test.pcLocal.setIdentityProvider("test1.example.com", "idp.js", "someone");
test.pcRemote.setIdentityProvider("test2.example.com", "idp.js", "someone");
test.chain.append([
function PC_LOCAL_PEER_IDENTITY_IS_SET_CORRECTLY(test) {

Просмотреть файл

@ -18,9 +18,7 @@ runNetworkTest(function () {
test.setMediaConstraints([{audio: true}], [{audio: true}]);
// No IdP for local.
// Remote generates a bad assertion, but that only fails to validate
test.pcRemote.setIdentityProvider('example.com',
{ protocol: 'idp.js#bad-validate',
usernameHint: 'nobody' });
test.pcRemote.setIdentityProvider('example.com', 'idp.js#bad-validate', 'nobody');
// Save the peerIdentity promises now, since when they reject they are
// replaced and we expect them to be rejected this time

Просмотреть файл

@ -873,8 +873,8 @@ PeerConnectionWrapper.prototype = {
return this._pc.iceConnectionState;
},
setIdentityProvider: function(provider, options) {
this._pc.setIdentityProvider(provider, options);
setIdentityProvider: function(provider, protocol, identity) {
this._pc.setIdentityProvider(provider, protocol, identity);
},
elementPrefix : direction =>

Просмотреть файл

@ -63,13 +63,13 @@ RTCIdentityProviderRegistrar::HasIdp() const
already_AddRefed<Promise>
RTCIdentityProviderRegistrar::GenerateAssertion(
const nsAString& aContents, const nsAString& aOrigin,
const RTCIdentityProviderOptions& aOptions, ErrorResult& aRv)
const Optional<nsAString>& aUsernameHint, ErrorResult& aRv)
{
if (!mGenerateAssertionCallback) {
aRv.Throw(NS_ERROR_NOT_INITIALIZED);
return nullptr;
}
return mGenerateAssertionCallback->Call(aContents, aOrigin, aOptions, aRv);
return mGenerateAssertionCallback->Call(aContents, aOrigin, aUsernameHint, aRv);
}
already_AddRefed<Promise>
RTCIdentityProviderRegistrar::ValidateAssertion(

Просмотреть файл

@ -40,8 +40,7 @@ public:
already_AddRefed<Promise>
GenerateAssertion(const nsAString& aContents, const nsAString& aOrigin,
const RTCIdentityProviderOptions& aOptions,
ErrorResult& aRv);
const Optional<nsAString>& aUsernameHint, ErrorResult& aRv);
already_AddRefed<Promise>
ValidateAssertion(const nsAString& assertion, const nsAString& origin,
ErrorResult& aRv);

Просмотреть файл

@ -23,7 +23,7 @@ interface RTCIdentityProviderRegistrar {
[ChromeOnly, Throws]
Promise<RTCIdentityAssertionResult>
generateAssertion(DOMString contents, DOMString origin,
optional RTCIdentityProviderOptions options);
optional DOMString usernameHint);
/* Forward to idp.validateAssertion() */
[ChromeOnly, Throws]
Promise<RTCIdentityValidationResult>
@ -37,8 +37,7 @@ dictionary RTCIdentityProvider {
callback GenerateAssertionCallback =
Promise<RTCIdentityAssertionResult>
(DOMString contents, DOMString origin,
RTCIdentityProviderOptions options);
(DOMString contents, DOMString origin, optional DOMString usernameHint);
callback ValidateAssertionCallback =
Promise<RTCIdentityValidationResult> (DOMString assertion, DOMString origin);
@ -56,10 +55,3 @@ dictionary RTCIdentityValidationResult {
required DOMString identity;
required DOMString contents;
};
dictionary RTCIdentityProviderOptions {
DOMString protocol = "default";
DOMString usernameHint;
DOMString peerIdentity;
};

Просмотреть файл

@ -83,7 +83,8 @@ interface RTCPeerConnection : EventTarget {
[Pref="media.peerconnection.identity.enabled"]
void setIdentityProvider (DOMString provider,
optional RTCIdentityProviderOptions options);
optional DOMString protocol,
optional DOMString username);
[Pref="media.peerconnection.identity.enabled"]
Promise<DOMString> getIdentityAssertion();
Promise<RTCSessionDescriptionInit> createOffer (optional RTCOfferOptions options);