diff --git a/webapprt/test/chrome/head.js b/webapprt/test/chrome/head.js index e91af6ba2fa9..77777fb4853e 100644 --- a/webapprt/test/chrome/head.js +++ b/webapprt/test/chrome/head.js @@ -37,8 +37,10 @@ function loadWebapp(manifest, parameters, onLoad) { registerCleanupFunction(function() { // We load DOMApplicationRegistry into a local scope to avoid appearing // to leak it. - let scope = {}; - Cu.import("resource://gre/modules/Webapps.jsm", scope); - scope.DOMApplicationRegistry.uninstall(url.spec); + let { DOMApplicationRegistry } = Cu.import("resource://gre/modules/Webapps.jsm", {}); + + return new Promise(function(resolve, reject) { + DOMApplicationRegistry.uninstall(url.spec, resolve, reject); + }); }); }