dom/indexedDB/test/bug839193.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/indexedDB/test/bug839193.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +const nsIQuotaManager = Components.interfaces.nsIQuotaManager;
     1.9 +
    1.10 +let gURI = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("http://localhost", null, null);
    1.11 +
    1.12 +function onUsageCallback(uri, usage, fileUsage) {}
    1.13 +
    1.14 +function onLoad()
    1.15 +{
    1.16 +  var quotaManager = Components.classes["@mozilla.org/dom/quota/manager;1"]
    1.17 +                               .getService(nsIQuotaManager);
    1.18 +  var quotaRequest = quotaManager.getUsageForURI(gURI, onUsageCallback);
    1.19 +  quotaRequest.cancel();
    1.20 +  Components.classes["@mozilla.org/observer-service;1"]
    1.21 +            .getService(Components.interfaces.nsIObserverService)
    1.22 +            .notifyObservers(window, "bug839193-loaded", null);
    1.23 +}
    1.24 +
    1.25 +function onUnload()
    1.26 +{
    1.27 +  Components.classes["@mozilla.org/observer-service;1"]
    1.28 +            .getService(Components.interfaces.nsIObserverService)
    1.29 +            .notifyObservers(window, "bug839193-unloaded", null);
    1.30 +}

mercurial