summaryrefslogtreecommitdiffstats
path: root/addon-sdk/source/test/addons/require
diff options
context:
space:
mode:
Diffstat (limited to 'addon-sdk/source/test/addons/require')
-rw-r--r--addon-sdk/source/test/addons/require/list.js6
-rw-r--r--addon-sdk/source/test/addons/require/main.js87
-rw-r--r--addon-sdk/source/test/addons/require/multiple/a.js5
-rw-r--r--addon-sdk/source/test/addons/require/multiple/b.js5
-rw-r--r--addon-sdk/source/test/addons/require/package.json8
-rw-r--r--addon-sdk/source/test/addons/require/packages/tabs/main.js5
-rw-r--r--addon-sdk/source/test/addons/require/packages/tabs/package.json3
-rw-r--r--addon-sdk/source/test/addons/require/packages/tabs/page-mod.js5
-rw-r--r--addon-sdk/source/test/addons/require/same-folder.js5
-rw-r--r--addon-sdk/source/test/addons/require/sub-folder/module.js5
-rw-r--r--addon-sdk/source/test/addons/require/tabs.js5
11 files changed, 0 insertions, 139 deletions
diff --git a/addon-sdk/source/test/addons/require/list.js b/addon-sdk/source/test/addons/require/list.js
deleted file mode 100644
index 9d2566a87..000000000
--- a/addon-sdk/source/test/addons/require/list.js
+++ /dev/null
@@ -1,6 +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";
-
-exports.local = true;
diff --git a/addon-sdk/source/test/addons/require/main.js b/addon-sdk/source/test/addons/require/main.js
deleted file mode 100644
index 53391f08b..000000000
--- a/addon-sdk/source/test/addons/require/main.js
+++ /dev/null
@@ -1,87 +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";
-
-var { isNative } = require("@loader/options");
-
-exports["test local vs sdk module"] = function (assert) {
- assert.notEqual(require("list"),
- require("sdk/util/list"),
- "Local module takes the priority over sdk modules");
- assert.ok(require("list").local,
- "this module is really the local one");
-}
-
-if (!isNative) {
- exports["test 3rd party vs sdk module"] = function (assert) {
- // We are testing with a 3rd party package called `tabs` with 3 modules
- // main, page-mod and third-party
-
- // the only way to require 3rd party package modules are to use absolute paths
- // require("tabs/main"), require("tabs/page-mod"),
- // require("tabs/third-party") and also require("tabs") which will refer
- // to tabs's main package module.
-
- // So require(page-mod) shouldn't map the 3rd party
- assert.equal(require("page-mod"),
- require("sdk/page-mod"),
- "Third party modules don't overload sdk modules");
-
- assert.ok(require("page-mod").PageMod,
- "page-mod module is really the sdk one");
-
- assert.equal(require("tabs/page-mod").id, "page-mod",
- "tabs/page-mod is the 3rd party");
-
- // But require(tabs) will map to 3rd party main module
- // *and* overload the sdk module
- // and also any local module with the same name
- assert.equal(require("tabs").id, "tabs-main",
- "Third party main module overload sdk modules");
-
- assert.equal(require("tabs"),
- require("tabs/main"),
- "require(tabs) maps to require(tabs/main)");
-
- // So that you have to use relative path to ensure getting the local module
- assert.equal(require("./tabs").id,
- "local-tabs",
- "require(./tabs) maps to the local module");
-
- // It should still be possible to require sdk module with absolute path
- assert.ok(require("sdk/tabs").open,
- "We can bypass this overloading with absolute path to sdk modules");
-
- assert.equal(require("sdk/tabs"),
- require("addon-kit/tabs"),
- "Old and new layout both work");
- }
-}
-
-// /!\ Always use distinct module for each test.
-// Otherwise, the linker can correctly parse and allow the first usage of it
-// but still silently fail on the second.
-
-exports.testRelativeRequire = function (assert) {
- assert.equal(require('./same-folder').id, 'same-folder');
-}
-
-exports.testRelativeSubFolderRequire = function (assert) {
- assert.equal(require('./sub-folder/module').id, 'sub-folder');
-}
-
-exports.testMultipleRequirePerLine = function (assert) {
- var a=require('./multiple/a'),b=require('./multiple/b');
- assert.equal(a.id, 'a');
- assert.equal(b.id, 'b');
-}
-
-exports.testSDKRequire = function (assert) {
- assert.deepEqual(Object.keys(require('sdk/page-worker')), ['Page']);
- if (!isNative) {
- assert.equal(require('page-worker'), require('sdk/page-worker'));
- }
-}
-
-require("sdk/test/runner").runTestsFromModule(module);
diff --git a/addon-sdk/source/test/addons/require/multiple/a.js b/addon-sdk/source/test/addons/require/multiple/a.js
deleted file mode 100644
index 737cce2b0..000000000
--- a/addon-sdk/source/test/addons/require/multiple/a.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = 'a';
diff --git a/addon-sdk/source/test/addons/require/multiple/b.js b/addon-sdk/source/test/addons/require/multiple/b.js
deleted file mode 100644
index 382a7d22c..000000000
--- a/addon-sdk/source/test/addons/require/multiple/b.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = 'b';
diff --git a/addon-sdk/source/test/addons/require/package.json b/addon-sdk/source/test/addons/require/package.json
deleted file mode 100644
index 828853f56..000000000
--- a/addon-sdk/source/test/addons/require/package.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "id": "test-require@jetpack",
- "name": "test-require",
- "packages": "packages",
- "ignore-deprecated-path": true,
- "main": "./main.js",
- "version": "0.0.1"
-}
diff --git a/addon-sdk/source/test/addons/require/packages/tabs/main.js b/addon-sdk/source/test/addons/require/packages/tabs/main.js
deleted file mode 100644
index 871c9e4de..000000000
--- a/addon-sdk/source/test/addons/require/packages/tabs/main.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = "tabs-main";
diff --git a/addon-sdk/source/test/addons/require/packages/tabs/package.json b/addon-sdk/source/test/addons/require/packages/tabs/package.json
deleted file mode 100644
index 2446c2e53..000000000
--- a/addon-sdk/source/test/addons/require/packages/tabs/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "id": "test-panel"
-} \ No newline at end of file
diff --git a/addon-sdk/source/test/addons/require/packages/tabs/page-mod.js b/addon-sdk/source/test/addons/require/packages/tabs/page-mod.js
deleted file mode 100644
index 6c90f46c1..000000000
--- a/addon-sdk/source/test/addons/require/packages/tabs/page-mod.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = "page-mod";
diff --git a/addon-sdk/source/test/addons/require/same-folder.js b/addon-sdk/source/test/addons/require/same-folder.js
deleted file mode 100644
index d2f9b017d..000000000
--- a/addon-sdk/source/test/addons/require/same-folder.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = 'same-folder';
diff --git a/addon-sdk/source/test/addons/require/sub-folder/module.js b/addon-sdk/source/test/addons/require/sub-folder/module.js
deleted file mode 100644
index 8ce8181b2..000000000
--- a/addon-sdk/source/test/addons/require/sub-folder/module.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = 'sub-folder';
diff --git a/addon-sdk/source/test/addons/require/tabs.js b/addon-sdk/source/test/addons/require/tabs.js
deleted file mode 100644
index 5a46e63b8..000000000
--- a/addon-sdk/source/test/addons/require/tabs.js
+++ /dev/null
@@ -1,5 +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/. */
-
-exports.id = "local-tabs";