Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: js/xpconnect/tests/unit/xpcshell.toml
/* Any copyright is dedicated to the Public Domain.
function run_test() {
{ wantGlobalProperties: ['rtcIdentityProvider'] });
function exerciseInterface() {
equal(typeof rtcIdentityProvider, 'object');
equal(typeof rtcIdentityProvider.register, 'function');
rtcIdentityProvider.register({
generateAssertion: function(a, b, c) {
return Promise.resolve({
idp: { domain: 'example.com' },
assertion: JSON.stringify([a, b, c])
});
},
validateAssertion: function(d, e) {
return Promise.resolve({
identity: 'user@example.com',
contents: JSON.stringify([d, e])
});
}
});
}
sb.equal = equal;
Cu.evalInSandbox('(' + exerciseInterface.toSource() + ')();', sb);
ok(sb.rtcIdentityProvider.hasIdp);
Cu.importGlobalProperties(['rtcIdentityProvider']);
exerciseInterface();
ok(rtcIdentityProvider.hasIdp);
}