From f0aa6a94a79e0a2b3f95601259e757ee0bba3bc0 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 20 May 2015 14:26:32 -0700 Subject: [PATCH] Bug 1155898 - Use fetch instead of XHR for IdP. r=jib --- dom/media/IdpSandbox.jsm | 2 +- dom/media/tests/mochitest/identity/idp.js | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dom/media/IdpSandbox.jsm b/dom/media/IdpSandbox.jsm index 95c594697b4..1018e573d90 100644 --- a/dom/media/IdpSandbox.jsm +++ b/dom/media/IdpSandbox.jsm @@ -207,7 +207,7 @@ IdpSandbox.prototype = { wantGlobalProperties: [ 'indexedDB', 'XMLHttpRequest', 'TextEncoder', 'TextDecoder', 'URL', 'URLSearchParams', 'atob', 'btoa', 'Blob', 'crypto', - 'rtcIdentityProvider' + 'rtcIdentityProvider', 'fetch' ] }); let registrar = this.sandbox.rtcIdentityProvider; diff --git a/dom/media/tests/mochitest/identity/idp.js b/dom/media/tests/mochitest/identity/idp.js index 36c9e3d0e67..21f3d764044 100644 --- a/dom/media/tests/mochitest/identity/idp.js +++ b/dom/media/tests/mochitest/identity/idp.js @@ -21,12 +21,8 @@ IDPJS.prototype = { getLogin: function() { - var xhr = new XMLHttpRequest(); - xhr.open('GET', 'https://example.com/.well-known/idp-proxy/idp.sjs?' + this.id); - return new Promise(resolve => { - xhr.onload = e => resolve(xhr.status === 200); - xhr.send(); - }); + return fetch('https://example.com/.well-known/idp-proxy/idp.sjs?' + this.id) + .then(response => response.status === 200); }, checkLogin: function(result) { return this.getLogin()