mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 17:54:12 +01:00
Manually run Ex completers rather than pushing them through the
command line machinery. It's orders of magnitude faster, on the one hand, but also runs the display machinery for all results, which may catch more errors. Errors in the command line completion machinery should be tested elsewhere. Fix some sidebar test bugs. Move dactyl.js and utils.js files out of sandboxes and into modules so we can pass XML objects in and out of them. --HG-- rename : common/tests/functional/dactyl.js => common/tests/functional/dactyl.jsm rename : common/tests/functional/utils.js => common/tests/functional/utils.jsm
This commit is contained in:
@@ -1,50 +1,5 @@
|
||||
function module(uri) {
|
||||
let obj = {};
|
||||
Components.utils.import(uri, obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
var elementslib = module("resource://mozmill/modules/elementslib.js");
|
||||
var frame = module("resource://mozmill/modules/frame.js");
|
||||
var jumlib = module("resource://mozmill/modules/jum.js");
|
||||
|
||||
function toJSON(val) {
|
||||
if (typeof val == "function")
|
||||
return val.toSource();
|
||||
if (val instanceof Ci.nsIDOMNode || val instanceof Ci.nsIDOMWindow)
|
||||
return { DOMNode: String(val) };
|
||||
return val;
|
||||
}
|
||||
|
||||
function test(val, params) {
|
||||
frame.events[val ? "pass" : "fail"](params);
|
||||
return val;
|
||||
}
|
||||
|
||||
for (var [k, v] in Iterator({
|
||||
|
||||
NS: Namespace("dactyl", "http://vimperator.org/namespaces/liberator"),
|
||||
|
||||
module: module,
|
||||
|
||||
toJSON: toJSON,
|
||||
|
||||
test: test,
|
||||
|
||||
assert: function (funcName, value, comment)
|
||||
test(value, {
|
||||
function: funcName,
|
||||
value: toJSON(value),
|
||||
comment: toJSON(comment)
|
||||
}),
|
||||
|
||||
assertEqual: function (funcName, want, got, comment)
|
||||
test(want == got, {
|
||||
function: funcName,
|
||||
want: toJSON(want), got: toJSON(got),
|
||||
comment: toJSON(comment)
|
||||
})
|
||||
}))
|
||||
exports[k] = v;
|
||||
// Work around these horrendous Sandbox issues.
|
||||
Components.utils.import(/([^ ]+\/)[^\/]+$/.exec(Components.stack.filename)[1] + "utils.jsm", exports);
|
||||
|
||||
// vim: sw=4 ts=8 et:
|
||||
|
||||
Reference in New Issue
Block a user