toolkit/mozapps/update/tests/unit_timermanager/consumerNotifications.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4 */
michael@0 5
michael@0 6 /* General Update Timer Manager Tests */
michael@0 7
michael@0 8 const Cc = Components.classes;
michael@0 9 const Ci = Components.interfaces;
michael@0 10 const Cm = Components.manager;
michael@0 11 const Cr = Components.results;
michael@0 12
michael@0 13 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
michael@0 14
michael@0 15 const CATEGORY_UPDATE_TIMER = "update-timer";
michael@0 16
michael@0 17 const PREF_APP_UPDATE_TIMERMINIMUMDELAY = "app.update.timerMinimumDelay";
michael@0 18 const PREF_APP_UPDATE_TIMERFIRSTINTERVAL = "app.update.timerFirstInterval";
michael@0 19 const PREF_APP_UPDATE_LOG_ALL = "app.update.log.all";
michael@0 20 const PREF_BRANCH_LAST_UPDATE_TIME = "app.update.lastUpdateTime.";
michael@0 21
michael@0 22 const MAIN_TIMER_INTERVAL = 1000; // milliseconds
michael@0 23 const CONSUMER_TIMER_INTERVAL = 1; // seconds
michael@0 24
michael@0 25 const TESTS = [ {
michael@0 26 desc : "Test Timer Callback 1",
michael@0 27 timerID : "test1-update-timer",
michael@0 28 defaultInterval : "bogus",
michael@0 29 prefInterval : "test1.timer.interval",
michael@0 30 contractID : "@mozilla.org/test1/timercallback;1",
michael@0 31 method : "createInstance",
michael@0 32 classID : Components.ID("9c7ce81f-98bb-4729-adb4-4d0deb0f59e5"),
michael@0 33 notified : false
michael@0 34 }, {
michael@0 35 desc : "Test Timer Callback 2",
michael@0 36 timerID : "test2-update-timer",
michael@0 37 defaultInterval : 86400,
michael@0 38 prefInterval : "test2.timer.interval",
michael@0 39 contractID : "@mozilla.org/test2/timercallback;1",
michael@0 40 method : "createInstance",
michael@0 41 classID : Components.ID("512834f3-05bb-46be-84e0-81d881a140b7"),
michael@0 42 notified : false
michael@0 43 }, {
michael@0 44 desc : "Test Timer Callback 3",
michael@0 45 timerID : "test3-update-timer",
michael@0 46 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 47 prefInterval : "test3.timer.interval",
michael@0 48 contractID : "@mozilla.org/test3/timercallback;1",
michael@0 49 method : "createInstance",
michael@0 50 classID : Components.ID("c8ac5027-8d11-4471-9d7c-fd692501b437"),
michael@0 51 notified : false
michael@0 52 }, {
michael@0 53 desc : "Test Timer Callback 4",
michael@0 54 timerID : "test4-update-timer",
michael@0 55 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 56 prefInterval : "test4.timer.interval",
michael@0 57 contractID : "@mozilla.org/test4/timercallback;1",
michael@0 58 method : "createInstance",
michael@0 59 classID : Components.ID("6b0e79f3-4ab8-414c-8f14-dde10e185727"),
michael@0 60 notified : false
michael@0 61 }, {
michael@0 62 desc : "Test Timer Callback 5",
michael@0 63 timerID : "test5-update-timer",
michael@0 64 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 65 prefInterval : "test5.timer.interval",
michael@0 66 contractID : "@mozilla.org/test5/timercallback;1",
michael@0 67 method : "createInstance",
michael@0 68 classID : Components.ID("2f6b7b92-e40f-4874-bfbb-eeb2412c959d"),
michael@0 69 notified : false
michael@0 70 }, {
michael@0 71 desc : "Test Timer Callback 6",
michael@0 72 timerID : "test6-update-timer",
michael@0 73 defaultInterval : 86400,
michael@0 74 prefInterval : "test6.timer.interval",
michael@0 75 contractID : "@mozilla.org/test6/timercallback;1",
michael@0 76 method : "createInstance",
michael@0 77 classID : Components.ID("8a95f611-b2ac-4c7e-8b73-9748c4839731"),
michael@0 78 notified : false
michael@0 79 }, {
michael@0 80 desc : "Test Timer Callback 7",
michael@0 81 timerID : "test7-update-timer",
michael@0 82 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 83 prefInterval : "test7.timer.interval",
michael@0 84 contractID : "@mozilla.org/test7/timercallback;1",
michael@0 85 method : "createInstance",
michael@0 86 classID : Components.ID("2d091020-e23c-11e2-a28f-0800200c9a66"),
michael@0 87 notified : false
michael@0 88 }, {
michael@0 89 desc : "Test Timer Callback 8",
michael@0 90 timerID : "test8-update-timer",
michael@0 91 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 92 contractID : "@mozilla.org/test8/timercallback;1",
michael@0 93 classID : Components.ID("af878d4b-1d12-41f6-9a90-4e687367ecc1"),
michael@0 94 notified : false,
michael@0 95 lastUpdateTime : 0
michael@0 96 }, {
michael@0 97 desc : "Test Timer Callback 9",
michael@0 98 timerID : "test9-update-timer",
michael@0 99 defaultInterval : CONSUMER_TIMER_INTERVAL,
michael@0 100 contractID : "@mozilla.org/test9/timercallback;1",
michael@0 101 classID : Components.ID("5136b201-d64c-4328-8cf1-1a63491cc117"),
michael@0 102 notified : false,
michael@0 103 lastUpdateTime : 0
michael@0 104 } ];
michael@0 105
michael@0 106 var gUTM;
michael@0 107 var gNextFunc;
michael@0 108
michael@0 109 XPCOMUtils.defineLazyServiceGetter(this, "gPref",
michael@0 110 "@mozilla.org/preferences-service;1",
michael@0 111 "nsIPrefBranch");
michael@0 112
michael@0 113 XPCOMUtils.defineLazyServiceGetter(this, "gCatMan",
michael@0 114 "@mozilla.org/categorymanager;1",
michael@0 115 "nsICategoryManager");
michael@0 116
michael@0 117 XPCOMUtils.defineLazyGetter(this, "gCompReg", function() {
michael@0 118 return Cm.QueryInterface(Ci.nsIComponentRegistrar);
michael@0 119 });
michael@0 120
michael@0 121 function run_test() {
michael@0 122 do_test_pending();
michael@0 123
michael@0 124 // Set the timer to fire every second
michael@0 125 gPref.setIntPref(PREF_APP_UPDATE_TIMERMINIMUMDELAY, MAIN_TIMER_INTERVAL/1000);
michael@0 126 gPref.setIntPref(PREF_APP_UPDATE_TIMERFIRSTINTERVAL, MAIN_TIMER_INTERVAL);
michael@0 127 gPref.setBoolPref(PREF_APP_UPDATE_LOG_ALL, true);
michael@0 128
michael@0 129 // Remove existing update timers to prevent them from being notified
michael@0 130 var entries = gCatMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
michael@0 131 while (entries.hasMoreElements()) {
michael@0 132 let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
michael@0 133 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, entry, false);
michael@0 134 }
michael@0 135
michael@0 136 gUTM = Cc["@mozilla.org/updates/timer-manager;1"].
michael@0 137 getService(Ci.nsIUpdateTimerManager).
michael@0 138 QueryInterface(Ci.nsIObserver);
michael@0 139 gUTM.observe(null, "utm-test-init", "");
michael@0 140
michael@0 141 do_execute_soon(run_test1thru7);
michael@0 142 }
michael@0 143
michael@0 144 function end_test() {
michael@0 145 gUTM.observe(null, "xpcom-shutdown", "");
michael@0 146 do_test_finished();
michael@0 147 }
michael@0 148
michael@0 149 function run_test1thru7() {
michael@0 150 gNextFunc = check_test1thru7;
michael@0 151 // bogus default interval
michael@0 152 gCompReg.registerFactory(TESTS[0].classID, TESTS[0].desc,
michael@0 153 TESTS[0].contractID, gTest1Factory);
michael@0 154 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[0].desc,
michael@0 155 [TESTS[0].contractID, TESTS[0].method,
michael@0 156 TESTS[0].timerID, TESTS[0].prefInterval,
michael@0 157 TESTS[0].defaultInterval].join(","), false, true);
michael@0 158
michael@0 159 // doesn't implement nsITimerCallback
michael@0 160 gCompReg.registerFactory(TESTS[1].classID, TESTS[1].desc,
michael@0 161 TESTS[1].contractID, gTest2Factory);
michael@0 162 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[1].desc,
michael@0 163 [TESTS[1].contractID, TESTS[1].method,
michael@0 164 TESTS[1].timerID, TESTS[1].prefInterval,
michael@0 165 TESTS[1].defaultInterval].join(","), false, true);
michael@0 166
michael@0 167 // has a last update time of now - 43200 which is half of its interval
michael@0 168 var lastUpdateTime = Math.round(Date.now() / 1000) - 43200;
michael@0 169 gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[2].timerID, lastUpdateTime);
michael@0 170 gCompReg.registerFactory(TESTS[2].classID, TESTS[2].desc,
michael@0 171 TESTS[2].contractID, gTest3Factory);
michael@0 172 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[2].desc,
michael@0 173 [TESTS[2].contractID, TESTS[2].method,
michael@0 174 TESTS[2].timerID, TESTS[2].prefInterval,
michael@0 175 TESTS[2].defaultInterval].join(","), false, true);
michael@0 176
michael@0 177 // doesn't have a notify method
michael@0 178 gCompReg.registerFactory(TESTS[3].classID, TESTS[3].desc,
michael@0 179 TESTS[3].contractID, gTest4Factory);
michael@0 180 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[3].desc,
michael@0 181 [TESTS[3].contractID, TESTS[3].method,
michael@0 182 TESTS[3].timerID, TESTS[3].prefInterval,
michael@0 183 TESTS[3].defaultInterval].join(","), false, true);
michael@0 184
michael@0 185 // already has a last update time
michael@0 186 gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[4].timerID, 1);
michael@0 187 gCompReg.registerFactory(TESTS[4].classID, TESTS[4].desc,
michael@0 188 TESTS[4].contractID, gTest5Factory);
michael@0 189 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[4].desc,
michael@0 190 [TESTS[4].contractID, TESTS[4].method,
michael@0 191 TESTS[4].timerID, TESTS[4].prefInterval,
michael@0 192 TESTS[4].defaultInterval].join(","), false, true);
michael@0 193
michael@0 194 // has an interval preference that overrides the default
michael@0 195 gPref.setIntPref(TESTS[5].prefInterval, CONSUMER_TIMER_INTERVAL);
michael@0 196 gCompReg.registerFactory(TESTS[5].classID, TESTS[5].desc,
michael@0 197 TESTS[5].contractID, gTest6Factory);
michael@0 198 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[5].desc,
michael@0 199 [TESTS[5].contractID, TESTS[5].method,
michael@0 200 TESTS[5].timerID, TESTS[5].prefInterval,
michael@0 201 TESTS[5].defaultInterval].join(","), false, true);
michael@0 202
michael@0 203 // has a next update time 24 hours from now
michael@0 204 var nextUpdateTime = Math.round(Date.now() / 1000) + 86400;
michael@0 205 gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[6].timerID, nextUpdateTime);
michael@0 206 gCompReg.registerFactory(TESTS[6].classID, TESTS[6].desc,
michael@0 207 TESTS[6].contractID, gTest7Factory);
michael@0 208 gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[6].desc,
michael@0 209 [TESTS[6].contractID, TESTS[6].method,
michael@0 210 TESTS[6].timerID, TESTS[6].prefInterval,
michael@0 211 TESTS[6].defaultInterval].join(","), false, true);
michael@0 212 }
michael@0 213
michael@0 214 function finished_test1thru7() {
michael@0 215 if (TESTS[4].notified && TESTS[5].notified && TESTS[6].notified)
michael@0 216 do_timeout(0, gNextFunc);
michael@0 217 }
michael@0 218
michael@0 219 function check_test1thru7() {
michael@0 220 dump("Testing: a category registered timer didn't fire due to an invalid " +
michael@0 221 "default interval\n");
michael@0 222 do_check_false(TESTS[0].notified);
michael@0 223
michael@0 224 dump("Testing: a category registered timer didn't fire due to not " +
michael@0 225 "implementing nsITimerCallback\n");
michael@0 226 do_check_false(TESTS[1].notified);
michael@0 227
michael@0 228 dump("Testing: a category registered timer didn't fire due to the next " +
michael@0 229 "update time being in the future\n");
michael@0 230 do_check_false(TESTS[2].notified);
michael@0 231
michael@0 232 dump("Testing: a category registered timer didn't fire due to not " +
michael@0 233 "having a notify method\n");
michael@0 234 do_check_false(TESTS[3].notified);
michael@0 235
michael@0 236 dump("Testing: a category registered timer has fired\n");
michael@0 237 do_check_true(TESTS[4].notified);
michael@0 238
michael@0 239 dump("Testing: a category registered timer fired that has an interval " +
michael@0 240 "preference that overrides a default that wouldn't have fired yet\n");
michael@0 241 do_check_true(TESTS[5].notified);
michael@0 242
michael@0 243 dump("Testing: a category registered timer has fired due to the next " +
michael@0 244 "update time being reset due to a future last update time\n");
michael@0 245 do_check_true(TESTS[6].notified);
michael@0 246
michael@0 247 dump("Testing: two category registered timers last update time has " +
michael@0 248 "user values\n");
michael@0 249 do_check_true(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
michael@0 250 TESTS[4].timerID));
michael@0 251 do_check_true(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
michael@0 252 TESTS[5].timerID));
michael@0 253
michael@0 254 // Remove the category timers that should have failed
michael@0 255 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[0].desc, true);
michael@0 256 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[1].desc, true);
michael@0 257 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[2].desc, true);
michael@0 258 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[3].desc, true);
michael@0 259 var count = 0;
michael@0 260 var entries = gCatMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
michael@0 261 while (entries.hasMoreElements()) {
michael@0 262 let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
michael@0 263 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, entry, false);
michael@0 264 count++;
michael@0 265 }
michael@0 266 dump("Testing: no " + CATEGORY_UPDATE_TIMER + " categories are still " +
michael@0 267 "registered\n");
michael@0 268 do_check_eq(count, 0);
michael@0 269
michael@0 270 do_timeout(0, run_test8);
michael@0 271 }
michael@0 272
michael@0 273 function run_test8() {
michael@0 274 gNextFunc = check_test8;
michael@0 275 for (var i = 0; i < 2; i++) {
michael@0 276 gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[7 + i].timerID, 1);
michael@0 277 gCompReg.registerFactory(TESTS[7 + i].classID, TESTS[7 + i].desc,
michael@0 278 TESTS[7 + i].contractID, eval("gTest" + (8 + i) + "Factory"));
michael@0 279 gUTM.registerTimer(TESTS[7 + i].timerID, eval("gTest" + (8 + i) + "TimerCallback"),
michael@0 280 TESTS[7 + i].defaultInterval);
michael@0 281 }
michael@0 282 }
michael@0 283
michael@0 284 function check_test8() {
michael@0 285 var self = arguments.callee;
michael@0 286 self.timesCalled = (self.timesCalled || 0) + 1;
michael@0 287 if (self.timesCalled < 2)
michael@0 288 return;
michael@0 289
michael@0 290 dump("Testing: two registerTimer registered timers have fired\n");
michael@0 291 for (var i = 0; i < 2; i++)
michael@0 292 do_check_true(TESTS[7 + i].notified);
michael@0 293
michael@0 294 // Check that 'staggering' has happened: even though the two events wanted to fire at
michael@0 295 // the same time, we waited a full MAIN_TIMER_INTERVAL between them.
michael@0 296 // (to avoid sensitivity to random timing issues, we fudge by a factor of 0.5 here)
michael@0 297 do_check_true(Math.abs(TESTS[7].notifyTime - TESTS[8].notifyTime) >=
michael@0 298 MAIN_TIMER_INTERVAL * 0.5);
michael@0 299
michael@0 300 dump("Testing: two registerTimer registered timers last update time have " +
michael@0 301 "been updated\n");
michael@0 302 for (var i = 0; i < 2; i++)
michael@0 303 do_check_neq(gPref.getIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[7 + i].timerID), 1);
michael@0 304 end_test();
michael@0 305 }
michael@0 306
michael@0 307 var gTest1TimerCallback = {
michael@0 308 notify: function T1CB_notify(aTimer) {
michael@0 309 do_throw("gTest1TimerCallback notify method should not have been called");
michael@0 310 },
michael@0 311 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 312 };
michael@0 313
michael@0 314 var gTest1Factory = {
michael@0 315 createInstance: function (outer, iid) {
michael@0 316 if (outer == null)
michael@0 317 return gTest1TimerCallback.QueryInterface(iid);
michael@0 318 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 319 }
michael@0 320 };
michael@0 321
michael@0 322 var gTest2TimerCallback = {
michael@0 323 notify: function T2CB_notify(aTimer) {
michael@0 324 do_throw("gTest2TimerCallback notify method should not have been called");
michael@0 325 },
michael@0 326 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimer])
michael@0 327 };
michael@0 328
michael@0 329 var gTest2Factory = {
michael@0 330 createInstance: function (outer, iid) {
michael@0 331 if (outer == null)
michael@0 332 return gTest2TimerCallback.QueryInterface(iid);
michael@0 333 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 334 }
michael@0 335 };
michael@0 336
michael@0 337 var gTest3TimerCallback = {
michael@0 338 notify: function T3CB_notify(aTimer) {
michael@0 339 do_throw("gTest3TimerCallback notify method should not have been called");
michael@0 340 },
michael@0 341 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 342 };
michael@0 343
michael@0 344 var gTest3Factory = {
michael@0 345 createInstance: function (outer, iid) {
michael@0 346 if (outer == null)
michael@0 347 return gTest3TimerCallback.QueryInterface(iid);
michael@0 348 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 349 }
michael@0 350 };
michael@0 351
michael@0 352 var gTest4TimerCallback = {
michael@0 353 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 354 };
michael@0 355
michael@0 356 var gTest4Factory = {
michael@0 357 createInstance: function (outer, iid) {
michael@0 358 if (outer == null)
michael@0 359 return gTest4TimerCallback.QueryInterface(iid);
michael@0 360 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 361 }
michael@0 362 };
michael@0 363
michael@0 364 var gTest5TimerCallback = {
michael@0 365 notify: function T5CB_notify(aTimer) {
michael@0 366 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[4].desc, true);
michael@0 367 TESTS[4].notified = true;
michael@0 368 finished_test1thru7();
michael@0 369 },
michael@0 370 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 371 };
michael@0 372
michael@0 373 var gTest5Factory = {
michael@0 374 createInstance: function (outer, iid) {
michael@0 375 if (outer == null)
michael@0 376 return gTest5TimerCallback.QueryInterface(iid);
michael@0 377 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 378 }
michael@0 379 };
michael@0 380
michael@0 381 var gTest6TimerCallback = {
michael@0 382 notify: function T6CB_notify(aTimer) {
michael@0 383 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[5].desc, true);
michael@0 384 TESTS[5].notified = true;
michael@0 385 finished_test1thru7();
michael@0 386 },
michael@0 387 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 388 };
michael@0 389
michael@0 390 var gTest6Factory = {
michael@0 391 createInstance: function (outer, iid) {
michael@0 392 if (outer == null)
michael@0 393 return gTest6TimerCallback.QueryInterface(iid);
michael@0 394 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 395 }
michael@0 396 };
michael@0 397
michael@0 398 var gTest7TimerCallback = {
michael@0 399 notify: function T7CB_notify(aTimer) {
michael@0 400 gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[6].desc, true);
michael@0 401 TESTS[6].notified = true;
michael@0 402 finished_test1thru7();
michael@0 403 },
michael@0 404 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 405 };
michael@0 406
michael@0 407 var gTest7Factory = {
michael@0 408 createInstance: function (outer, iid) {
michael@0 409 if (outer == null)
michael@0 410 return gTest7TimerCallback.QueryInterface(iid);
michael@0 411 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 412 }
michael@0 413 };
michael@0 414
michael@0 415 var gTest8TimerCallback = {
michael@0 416 notify: function T8CB_notify(aTimer) {
michael@0 417 TESTS[7].notified = true;
michael@0 418 TESTS[7].notifyTime = Date.now();
michael@0 419 do_timeout(0, check_test8);
michael@0 420 },
michael@0 421 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 422 };
michael@0 423
michael@0 424 var gTest8Factory = {
michael@0 425 createInstance: function (outer, iid) {
michael@0 426 if (outer == null)
michael@0 427 return gTest8TimerCallback.QueryInterface(iid);
michael@0 428 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 429 }
michael@0 430 };
michael@0 431
michael@0 432 var gTest9TimerCallback = {
michael@0 433 notify: function T9CB_notify(aTimer) {
michael@0 434 TESTS[8].notified = true;
michael@0 435 TESTS[8].notifyTime = Date.now();
michael@0 436 do_timeout(0, check_test8);
michael@0 437 },
michael@0 438 QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
michael@0 439 };
michael@0 440
michael@0 441 var gTest9Factory = {
michael@0 442 createInstance: function (outer, iid) {
michael@0 443 if (outer == null)
michael@0 444 return gTest9TimerCallback.QueryInterface(iid);
michael@0 445 throw Cr.NS_ERROR_NO_AGGREGATION;
michael@0 446 }
michael@0 447 };

mercurial