test_bug656331.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
  2. var Cc = Components.classes;
  3. var Ci = Components.interfaces;
  4. function info(s) {
  5. dump("TEST-INFO | test_bug656331.js | " + s + "\n");
  6. }
  7. var gMessageExpected = /Native module.*has version 3.*expected/;
  8. var gFound = false;
  9. const kConsoleListener = {
  10. QueryInterface: XPCOMUtils.generateQI([Ci.nsIConsoleListener]),
  11. observe: function listener_observe(message) {
  12. if (gMessageExpected.test(message.message))
  13. gFound = true;
  14. }
  15. };
  16. function run_test() {
  17. let cs = Components.classes["@mozilla.org/consoleservice;1"].
  18. getService(Ci.nsIConsoleService);
  19. cs.registerListener(kConsoleListener);
  20. let manifest = do_get_file('components/bug656331.manifest');
  21. registerAppManifest(manifest);
  22. do_check_false("{f18fb09b-28b4-4435-bc5b-8027f18df743}" in Components.classesByID);
  23. do_test_pending();
  24. Components.classes["@mozilla.org/thread-manager;1"].
  25. getService(Ci.nsIThreadManager).mainThread.dispatch(function() {
  26. cs.unregisterListener(kConsoleListener);
  27. do_check_true(gFound);
  28. do_test_finished();
  29. }, 0);
  30. }