michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: function run_test() { michael@0: print("Init the fake idle service and check its identity."); michael@0: let fakeIdleService = Components.classes["@mozilla.org/widget/idleservice;1"]. michael@0: getService(Components.interfaces.nsIIdleService); michael@0: try { michael@0: fakeIdleService.QueryInterface(Components.interfaces.nsIFactory); michael@0: } catch (ex) { michael@0: do_throw("The fake idle service implements nsIFactory."); michael@0: } michael@0: // We need at least one PASS, thus sanity check the idle time. michael@0: do_check_eq(fakeIdleService.idleTime, 0); michael@0: michael@0: print("Init the real idle service and check its identity."); michael@0: let realIdleService = do_get_idle(); michael@0: try { michael@0: realIdleService.QueryInterface(Components.interfaces.nsIFactory); michael@0: do_throw("The real idle service does not implement nsIFactory."); michael@0: } catch (ex) {} michael@0: }