2 var EXPORTED_SYMBOLS = ["NS", "assert", "assertEqual", "module", "test", "toJSON"];
4 const Ci = Components.interfaces;
7 if (!/^[a-z-]+:/.exec(uri))
8 uri = /([^ ]+\/)[^\/]+$/.exec(Components.stack.caller.filename)[1] + uri + ".jsm";
11 Components.utils.import(uri, obj);
15 var elementslib = module("resource://mozmill/modules/elementslib.js");
16 var frame = module("resource://mozmill/modules/frame.js");
17 var jumlib = module("resource://mozmill/modules/jum.js");
19 function toJSON(val) {
20 if (typeof val == "function")
21 return val.toSource();
22 if (val instanceof Ci.nsIDOMNode || val instanceof Ci.nsIDOMWindow)
23 return { DOMNode: String(val) };
27 function test(val, params) {
28 frame.events[val ? "pass" : "fail"](params);
32 var NS = Namespace("dactyl", "http://vimperator.org/namespaces/liberator");
34 function assert(funcName, value, comment)
38 comment: toJSON(comment)
41 function assertEqual(funcName, want, got, comment)
44 want: toJSON(want), got: toJSON(got),
45 comment: toJSON(comment)
48 // vim: sw=4 ts=8 et ft=javascript: