From d26b319fd6f98517cc3421f10bf18698b953e4d2 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Thu, 13 Sep 2018 20:39:48 -0400 Subject: Updated extensions list for v60 --- .../node_modules/pathfinder/test/test-storage.js | 134 --------------------- 1 file changed, 134 deletions(-) delete mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/test/test-storage.js (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/test/test-storage.js') diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/test/test-storage.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/test/test-storage.js deleted file mode 100644 index 14187cd..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/test/test-storage.js +++ /dev/null @@ -1,134 +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 { Loader } = require('sdk/test/loader'); -const { before, after } = require('sdk/test/utils'); - -const { get, set } = require('pathfinder/storage'); - -exports.testGetNothing = function(assert, done) { - get().then(function({ data }) { - assert.equal(data, '', 'the data is blank!'); - done(); - }); -}; - -exports.testSetThenGet = function(assert, done) { - const randomData = Math.random() + ''; - - // SET TO A RANDOM VALUE - set({ data: randomData }).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, randomData, 'the data returned from set is correct [' + randomData + ']'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, randomData, 'the data returned from get is correct [' + randomData + ']'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }) - // SET AGAIN - .then(function() set({ data: 'test' })).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, 'test', 'the data returned from set is correct [test]'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, 'test', 'the data returned from get is correct [test]'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }). - // SET TO BLANK - then(function() set({ data: '' })).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, '', 'the data returned from set is correct'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, '', 'the data returned from get is correct'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }). - // SET TO BLANK AGAIN - then(function() set({ data: '' })).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, '', 'the data returned from set is correct'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, '', 'the data returned from get is correct'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }).then(done, assert.fail); -}; - -exports.testSettingJSON = function(assert, done) { - const json = JSON.stringify({ - num: 1, - str: 'string', - bool: true, - obj: { x: 'x' }, - ary: [ 1, 2, 3 ] - }); - - set({ data: json }).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, json, 'the data returned from set is correct json'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, json, 'the data returned from get is correct json'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }). - // SET TO BLANK AGAIN - then(function() set({ data: '' })).then(function({ data }) { - assert.pass('setting was successful'); - assert.equal(data, '', 'the data returned from set is correct'); - }, function(e) { - assert.fail('setting was unsuccessful'); - assert.fail(e); - }).then(function() get()).then(function({ data }) { - assert.pass('getting was successful'); - assert.equal(data, '', 'the data returned from get is correct'); - }, function(e) { - assert.fail('getting was unsuccessful'); - assert.fail(e); - }).then(done, assert.fail); -}; - -before(exports, function(name, assert, done) { - let loader = Loader(module); - loader.require('pathfinder/storage'); - let file = loader.sandbox('pathfinder/storage').getStorageFile(); - assert.pass(file.exists(), false, 'the storage file DNE'); - loader.unload(); - done(); -}); -after(exports, function(name, assert, done) { - let loader = Loader(module); - loader.require('pathfinder/storage'); - let file = loader.sandbox('pathfinder/storage').getStorageFile(); - assert.pass(file.exists(), false, 'the storage file DNE'); - loader.unload(); - done(); -}); - -require('sdk/test').run(exports); -- cgit v1.2.3