|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 // Test that expiration runs on idle-daily. |
|
5 |
|
6 function run_test() { |
|
7 do_test_pending(); |
|
8 |
|
9 // Set interval to a large value so we don't expire on it. |
|
10 setInterval(3600); // 1h |
|
11 |
|
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); |
|
17 |
|
18 let expire = Cc["@mozilla.org/places/expiration;1"]. |
|
19 getService(Ci.nsIObserver); |
|
20 expire.observe(null, "idle-daily", null); |
|
21 } |