Bug 1358160 - Get usage from subject instead of data field, r=Fischer

MozReview-Commit-ID: 5UNttoq1jiX

--HG--
extra : rebase_source : b629cf3c33b54fe9a20ceb6e7d996d71917757fe
This commit is contained in:
Shawn Huang 2017-04-24 21:18:32 +08:00
Родитель 05789c2819
Коммит a776ab68f5
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -468,7 +468,7 @@ const gStoragePressureObserver = {
Services.prefs.getIntPref("browser.storageManager.pressureNotification.usageThresholdGB");
let msg = "";
let buttons = [];
let usage = parseInt(data);
let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data
let prefStrBundle = document.getElementById("bundle_preferences");
let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
let notificationBox = document.getElementById("high-priority-global-notificationbox");

Просмотреть файл

@ -4,7 +4,10 @@
function notifyStoragePressure(usage = 100) {
let notifyPromise = TestUtils.topicObserved("QuotaManager::StoragePressure", () => true);
Services.obs.notifyObservers(null, "QuotaManager::StoragePressure", usage);
let usageWrapper = Cc["@mozilla.org/supports-PRUint64;1"]
.createInstance(Ci.nsISupportsPRUint64);
usageWrapper.data = usage;
Services.obs.notifyObservers(usageWrapper, "QuotaManager::StoragePressure");
return notifyPromise;
}