summaryrefslogtreecommitdiffstats
path: root/addon-sdk/source/test/test-test-utils-async.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-09 06:46:43 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-09 06:46:43 -0500
commitac46df8daea09899ce30dc8fd70986e258c746bf (patch)
tree2750d3125fc253fd5b0671e4bd268eff1fd97296 /addon-sdk/source/test/test-test-utils-async.js
parent8cecf8d5208f3945b35f879bba3015bb1a11bec6 (diff)
downloadUXP-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-utils-async.js')
-rw-r--r--addon-sdk/source/test/test-test-utils-async.js86
1 files changed, 0 insertions, 86 deletions
diff --git a/addon-sdk/source/test/test-test-utils-async.js b/addon-sdk/source/test/test-test-utils-async.js
deleted file mode 100644
index 1465ce58c..000000000
--- a/addon-sdk/source/test/test-test-utils-async.js
+++ /dev/null
@@ -1,86 +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 { defer: async } = require('sdk/lang/functional');
-const { before, after } = require('sdk/test/utils');
-const { resolve } = require('sdk/core/promise');
-
-var AFTER_RUN = 0;
-var BEFORE_RUN = 0;
-
-/*
- * Tests are dependent on ordering, as the before and after functions
- * are called outside of each test, and sometimes checked in the next test
- * (like in the `after` tests)
- */
-exports.testABeforeAsync = function (assert, done) {
- assert.equal(BEFORE_RUN, 1, 'before function was called');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- async(done)();
-};
-
-exports.testABeforeNameAsync = function (assert, done) {
- assert.equal(BEFORE_RUN, 2, 'before function was called with name');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- async(done)();
-};
-
-exports.testAfterAsync = function (assert, done) {
- assert.equal(AFTER_RUN, 1, 'after function was called previously');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- async(done)();
-};
-
-exports.testAfterNameAsync = function (assert, done) {
- assert.equal(AFTER_RUN, 2, 'after function was called with name');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- async(done)();
-};
-
-exports.testSyncABefore = function (assert) {
- assert.equal(BEFORE_RUN, 1, 'before function was called for sync test');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
-};
-
-exports.testSyncAfter = function (assert) {
- assert.equal(AFTER_RUN, 1, 'after function was called for sync test');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
-};
-
-exports.testGeneratorBefore = function*(assert) {
- assert.equal(BEFORE_RUN, 1, 'before function was called for generator test');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- yield resolve();
-}
-
-exports.testGeneratorAfter = function*(assert) {
- assert.equal(AFTER_RUN, 1, 'after function was called for generator test');
- BEFORE_RUN = 0;
- AFTER_RUN = 0;
- yield resolve();
-};
-
-before(exports, (name, assert, done) => {
- BEFORE_RUN = (name === 'testABeforeNameAsync') ? 2 : 1;
- assert.pass('assert passed into before function');
- async(done)();
-});
-
-after(exports, (name, assert, done) => {
- // testAfterName runs after testAfter, which is where this
- // check occurs in the assertation
- AFTER_RUN = (name === 'testAfterAsync') ? 2 : 1;
- assert.pass('assert passed into after function');
- async(done)();
-});
-
-require('sdk/test').run(exports);