diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
commit | ac46df8daea09899ce30dc8fd70986e258c746bf (patch) | |
tree | 2750d3125fc253fd5b0671e4bd268eff1fd97296 /addon-sdk/source/test/test-test-loader.js | |
parent | 8cecf8d5208f3945b35f879bba3015bb1a11bec6 (diff) | |
download | UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.gz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.lz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.xz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.zip |
Move Add-on SDK source to toolkit/jetpack
Diffstat (limited to 'addon-sdk/source/test/test-test-loader.js')
-rw-r--r-- | addon-sdk/source/test/test-test-loader.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/addon-sdk/source/test/test-test-loader.js b/addon-sdk/source/test/test-test-loader.js deleted file mode 100644 index 6b47e4d0d..000000000 --- a/addon-sdk/source/test/test-test-loader.js +++ /dev/null @@ -1,59 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict" - -const { LoaderWithHookedConsole } = require("sdk/test/loader"); - -exports["test LoaderWithHookedConsole"] = function (assert) { - let count = 0; - function onMessage(type, message) { - switch (count++) { - case 0: - assert.equal(type, "log", "got log type"); - assert.equal(message, "1st", "got log msg"); - break; - case 1: - assert.equal(type, "error", "got error type"); - assert.equal(message, "2nd", "got error msg"); - break; - case 2: - assert.equal(type, "warn", "got warn type"); - assert.equal(message, "3rd", "got warn msg"); - break; - case 3: - assert.equal(type, "info", "got info type"); - assert.equal(message, "4th", "got info msg"); - break; - case 4: - assert.equal(type, "debug", "got debug type"); - assert.equal(message, "5th", "got debug msg"); - break; - case 5: - assert.equal(type, "exception", "got exception type"); - assert.equal(message, "6th", "got exception msg"); - break; - default: - assert.fail("Got unexception message: " + i); - } - } - - let { loader, messages } = LoaderWithHookedConsole(module, onMessage); - let console = loader.globals.console; - console.log("1st"); - console.error("2nd"); - console.warn("3rd"); - console.info("4th"); - console.debug("5th"); - console.exception("6th"); - assert.equal(messages.length, 6, "Got all console messages"); - assert.deepEqual(messages[0], {type: "log", msg: "1st", innerID: null}, "Got log"); - assert.deepEqual(messages[1], {type: "error", msg: "2nd", innerID: null}, "Got error"); - assert.deepEqual(messages[2], {type: "warn", msg: "3rd", innerID: null}, "Got warn"); - assert.deepEqual(messages[3], {type: "info", msg: "4th", innerID: null}, "Got info"); - assert.deepEqual(messages[4], {type: "debug", msg: "5th", innerID: null}, "Got debug"); - assert.deepEqual(messages[5], {type: "exception", msg: "6th", innerID: null}, "Got exception"); - assert.equal(count, 6, "Called for all messages"); -}; - -require("sdk/test").run(exports); |