addon-sdk/source/test/test-set-exports.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 let four = require("./modules/exportsEquals");
     6 exports.testExportsEquals = function(assert) {
     7   assert.equal(four, 4);
     8 };
    10 /* TODO: Discuss idea of dropping support for this feature that was alternative
    11          to `module.exports = ..` that failed.
    12 let five = require("./modules/setExports");
    13 exports.testSetExports = function(assert) {
    14   assert.equal(five, 5);
    15 }
    17 exports.testDupeSetExports = function(assert) {
    18   var passed = false;
    19   try {
    20     var dupe = require('./modules/dupeSetExports');
    21   } catch(e) {
    22     passed = /define\(\) was used, so module\.exports= and module\.setExports\(\) may not be used/.test(e.toString());
    23   }
    24   assert.equal(passed, true, 'define() or setExports(), not both');
    25 }
    26 */
    28 exports.testModule = function(assert) {
    29   // module.id is not cast in stone yet. In the future, it may include the
    30   // package name, or may possibly be a/ URL of some sort. For now, it's a
    31   // URL that starts with resource: and ends with this module name, but the
    32   // part in between varies depending upon how the test is run.
    33   var found = /test-set-exports$/.test(module.id);
    34   assert.equal(found, true, module.id+" ends with test-set-exports.js");
    35 };
    37 require('sdk/test').run(exports);

mercurial