X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Ftests%2Ffunctional%2Fdactyl.jsm;h=d738da635b1cfb630e5be285e2384e7d26c94f0b;hb=3d837eb266a3a01d424192aa4ec1a167366178c5;hp=9b2a20e74fc4f8de5000cb77b703fd91142e95f5;hpb=eeed0be1a8abf7e3c97f43b63c1d595e940fef21;p=dactyl.git diff --git a/common/tests/functional/dactyl.jsm b/common/tests/functional/dactyl.jsm index 9b2a20e..d738da6 100644 --- a/common/tests/functional/dactyl.jsm +++ b/common/tests/functional/dactyl.jsm @@ -40,7 +40,6 @@ function assertMessage(funcName, want, got, message) { * @param {MozMillController} controller The browser's MozMill controller. */ function Controller(controller) { - var self = this; this.controller = controller; /** @@ -51,13 +50,13 @@ function Controller(controller) { this.errorCount = 0; - this._countBeep = function countBeep() { - self.beepCount++; + this._countBeep = () => { + this.beepCount++; } this.errors = []; - this._countError = function countError(message, highlight) { + this._countError = (message, highlight) => { if (/\b(Error|Warning)Msg\b/.test(highlight)) - self.errors.push(String(message)); + this.errors.push(String(message)); } this.modules.dactyl.registerObserver("beep", this._countBeep); this.modules.dactyl.registerObserver("echoLine", this._countError); @@ -251,8 +250,7 @@ Controller.prototype = { * @param {string} message The message to display upon assertion failure. @optional */ wrapAssertNoErrors: function (func, message) { - let self = this; - return function wrapped() self.assertNoErrors(func, this, arguments, message); + return () => this.assertNoErrors(func, this, arguments, message); }, /** @@ -301,7 +299,7 @@ Controller.prototype = { }), /** - * Returns dactyl to normal mode. + * Returns dactyl to Normal mode. */ setNormalMode: wrapAssertNoErrors(function () { // XXX: Normal mode test @@ -313,9 +311,9 @@ Controller.prototype = { utils.assert("dactyl.setNormalMode", this.modules.modes.stack.length == 1, "Failed to return to Normal mode"); - this.assertMessageWindowOpen(false, "Returning to normal mode: Multi-line output not closed"); - this.assertMessageLine(function (msg) !msg, "Returning to normal mode: Message not cleared"); - }, "Returning to normal mode"), + this.assertMessageWindowOpen(false, "Returning to Normal mode: Multi-line output not closed"); + this.assertMessageLine(function (msg) !msg, "Returning to Normal mode: Message not cleared"); + }, "Returning to Normal mode"), /** * Returns dactyl to Ex mode. @@ -391,10 +389,10 @@ Controller.prototype = { * @param {...} Extra arguments are passed to the completion * function directly. */ - testCompleter: wrapAssertNoErrors(function testCompleter(self, func, string, message) { + testCompleter: wrapAssertNoErrors(function testCompleter(self, func, string, message, ...args) { var context = this.modules.CompletionContext(string || ""); context.tabPressed = true; - context.forkapply("completions", 0, self, func, Array.slice(arguments, testCompleter.length)); + context.forkapply("completions", 0, self, func, args); utils.assert("dactyl.runCompletions", context.wait(5000), message || "Completion failed: " + self + "." + func);