Bug 1047098 - Test to clear quota manger when clearing all history
MozReview-Commit-ID: Jz5XSneIOAk
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -12,16 +12,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
AppConstants: "resource://gre/modules/AppConstants.jsm",
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
FormHistory: "resource://gre/modules/FormHistory.jsm",
Downloads: "resource://gre/modules/Downloads.jsm",
DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
console: "resource://gre/modules/Console.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
+ SiteDataManager: "resource:///modules/SiteDataManager.jsm",
});
var {classes: Cc, interfaces: Ci} = Components;
/**
* A number of iterations after which to yield time back
* to the system.
*/
@@ -143,16 +144,21 @@ Sanitizer.prototype = {
seenError = true;
console.error("Error sanitizing " + name, ex);
};
// Array of objects in form { name, promise }.
// `name` is the item's name and `promise` may be a promise, if the
// sanitization is asynchronous, or the function return value, otherwise.
let handles = [];
+ // TEST for bug 1047098:
+ // If no tange, that means clear all data, including Quota Manger's data, like indexedDB.
+ if (!range) {
+ await SiteDataManager.removeAll();
+ }
for (let name of itemsToClear) {
let item = this.items[name];
try {
// Catch errors here, so later we can just loop through these.
handles.push({ name,
promise: item.clear(range)
.then(() => progress[name] = "cleared",
ex => annotateError(name, ex))