michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: "use strict"; michael@0: michael@0: var options = require("@loader/options"); michael@0: michael@0: exports.testPackaging = function(assert) { michael@0: assert.equal(options.metadata.description, michael@0: "Add-on development made easy.", michael@0: "packaging metadata should be available"); michael@0: try { michael@0: options.metadata.description = 'new description'; michael@0: assert.fail('should not have been able to set options.metadata property'); michael@0: } michael@0: catch (e) {} michael@0: michael@0: assert.equal(options.metadata.description, michael@0: "Add-on development made easy.", michael@0: "packaging metadata should be frozen"); michael@0: michael@0: assert.equal(options.metadata.permissions['private-browsing'], undefined, michael@0: "private browsing metadata should be undefined"); michael@0: assert.equal(options.metadata['private-browsing'], undefined, michael@0: "private browsing metadata should be be frozen"); michael@0: assert.equal(options['private-browsing'], undefined, michael@0: "private browsing metadata should be be frozen"); michael@0: michael@0: try { michael@0: options.metadata['private-browsing'] = true; michael@0: assert.fail('should not have been able to set options.metadata property'); michael@0: } michael@0: catch(e) {} michael@0: assert.equal(options.metadata['private-browsing'], undefined, michael@0: "private browsing metadata should be be frozen"); michael@0: michael@0: try { michael@0: options.metadata.permissions['private-browsing'] = true; michael@0: assert.fail('should not have been able to set options.metadata.permissions property'); michael@0: } michael@0: catch (e) {} michael@0: assert.equal(options.metadata.permissions['private-browsing'], undefined, michael@0: "private browsing metadata should be be frozen"); michael@0: }; michael@0: michael@0: require('sdk/test').run(exports);