From 75139375b76cb277546da2429d8e983ca6758f61 Mon Sep 17 00:00:00 2001 From: Rogan Creswick Date: Wed, 2 Jan 2013 14:56:40 -0800 Subject: added addon-sdk-1.7, without any changes --- .../packages/api-utils/tests/test-globals.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tools/addon-sdk-1.7/packages/api-utils/tests/test-globals.js (limited to 'tools/addon-sdk-1.7/packages/api-utils/tests/test-globals.js') diff --git a/tools/addon-sdk-1.7/packages/api-utils/tests/test-globals.js b/tools/addon-sdk-1.7/packages/api-utils/tests/test-globals.js new file mode 100644 index 0000000..1d8caf0 --- /dev/null +++ b/tools/addon-sdk-1.7/packages/api-utils/tests/test-globals.js @@ -0,0 +1,22 @@ +/* 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/. */ + +Object.defineProperty(this, "global", { value: this }); + +exports.testGlobals = function(test) { + // the only globals in module scope should be: + // module, exports, require, dump, console + test.assertObject(module, "have 'module', good"); + test.assertObject(exports, "have 'exports', good"); + test.assertFunction(require, "have 'require', good"); + test.assertFunction(dump, "have 'dump', good"); + test.assertObject(console, "have 'console', good"); + + // in particular, these old globals should no longer be present + test.assert(!('packaging' in global), "no 'packaging', good"); + test.assert(!('memory' in global), "no 'memory', good"); + + test.assertMatches(module.uri, /test-globals\.js$/, + 'should contain filename'); +}; -- cgit v1.2.3