mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
8cf4c9b6a3
--HG-- extra : rebase_source : f0a24b355e7669c30fb3b26d2e609d7145c197f8
20 lines
657 B
JavaScript
20 lines
657 B
JavaScript
function run_test() {
|
|
var jetpack = createJetpack({ scriptFile: do_get_file("impl.js") });
|
|
|
|
var sandbox = Components.utils.Sandbox("about:blank");
|
|
function registerReceiver(name, fn) {
|
|
jetpack.registerReceiver(name, fn);
|
|
}
|
|
sandbox.registerReceiver = registerReceiver;
|
|
sandbox.echoed = function(message, arg) {
|
|
do_check_eq(message, "echo");
|
|
do_check_eq(arg, "testdata");
|
|
jetpack.destroy();
|
|
sandbox = null;
|
|
do_test_finished();
|
|
};
|
|
Components.utils.evalInSandbox("registerReceiver('echo', function(message, arg){ echoed(message, arg); });", sandbox);
|
|
jetpack.sendMessage("echo", "testdata");
|
|
do_test_pending();
|
|
}
|