Bug 1286798 - Part 17: Fix a test failing in --verify mode; r=asuth
authorJan Varga <jan.varga@gmail.com>
Thu, 29 Nov 2018 21:48:08 +0100
changeset 505235 03b477c00c4f5ca4321efdc32bffa43bcae510d3
parent 505234 22ede10fb76d711eff32957567c9a7b087279e24
child 505236 61ce2d795e8e3db93cb8a191bad0a80b67eee92a
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1286798
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1286798 - Part 17: Fix a test failing in --verify mode; r=asuth
browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
@@ -87,16 +87,20 @@ async function checkIndexedDB(browser) {
     });
 
     try {
       db.transaction(["obj"], "readonly");
       ok(false, "The indexedDB should not exist");
     } catch (e) {
       is(e.name, "NotFoundError", "The indexedDB does not exist as expected");
     }
+
+    db.close();
+
+    content.indexedDB.deleteDatabase("idb");
   });
 }
 
 //
 // Test functions.
 //
 
 add_task(async function setup() {
@@ -122,17 +126,22 @@ add_task(async function test_quota_clear
 
   // Using quota manager to clear all indexed DB for a given domain.
   let caUtils = {};
   Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js",
                                       caUtils);
   let httpURI = caUtils.makeURI("http://" + TEST_HOST);
   let httpPrincipal = Services.scriptSecurityManager
                               .createCodebasePrincipal(httpURI, {});
-  Services.qms.clearStoragesForPrincipal(httpPrincipal, null, null, true);
+  let clearRequest = Services.qms.clearStoragesForPrincipal(httpPrincipal, null, null, true);
+  await new Promise(resolve => {
+    clearRequest.callback = () => {
+      resolve();
+    };
+  });
 
   for (let userContextId of Object.keys(USER_CONTEXTS)) {
     // Open our tab in the given user context.
     tabs[userContextId] = await openTabInUserContext(TEST_URL + "empty_file.html", userContextId);
 
     // Check whether indexed DB has been cleared.
     await checkIndexedDB(tabs[userContextId].browser);