toolkit/components/places/tests/expiration/test_idle_daily.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 // Test that expiration runs on idle-daily.
     6 function run_test() {
     7   do_test_pending();
     9   // Set interval to a large value so we don't expire on it.
    10   setInterval(3600); // 1h
    12   Services.obs.addObserver(function observeExpiration(aSubject, aTopic, aData) {
    13     Services.obs.removeObserver(observeExpiration,
    14                                 PlacesUtils.TOPIC_EXPIRATION_FINISHED);
    15     do_test_finished();
    16   }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
    18   let expire = Cc["@mozilla.org/places/expiration;1"].
    19                getService(Ci.nsIObserver);
    20   expire.observe(null, "idle-daily", null);
    21 }

mercurial