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 508015 03b477c00c4f5ca4321efdc32bffa43bcae510d3
parent 508014 22ede10fb76d711eff32957567c9a7b087279e24
child 508016 61ce2d795e8e3db93cb8a191bad0a80b67eee92a
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [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);