1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
5 let sb = new Cu.Sandbox('https://www.example.com',
6 { wantGlobalProperties: ['rtcIdentityProvider'] });
8 function exerciseInterface() {
9 equal(typeof rtcIdentityProvider, 'object');
10 equal(typeof rtcIdentityProvider.register, 'function');
11 rtcIdentityProvider.register({
12 generateAssertion: function(a, b, c) {
13 return Promise.resolve({
14 idp: { domain: 'example.com' },
15 assertion: JSON.stringify([a, b, c])
18 validateAssertion: function(d, e) {
19 return Promise.resolve({
20 identity: 'user@example.com',
21 contents: JSON.stringify([d, e])
28 Cu.evalInSandbox('(' + exerciseInterface.toSource() + ')();', sb);
29 ok(sb.rtcIdentityProvider.hasIdp);
31 Cu.importGlobalProperties(['rtcIdentityProvider']);
33 ok(rtcIdentityProvider.hasIdp);