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: michael@0: "use strict"; michael@0: michael@0: /** Disabled because of Bug 672199 michael@0: exports["test module exports are frozen"] = function(assert) { michael@0: assert.ok(Object.isFrozen(require("sdk/hotkeys")), michael@0: "module exports are frozen"); michael@0: }; michael@0: michael@0: exports["test redefine exported property"] = function(assert) { michael@0: let hotkeys = require("sdk/hotkeys"); michael@0: let { Hotkey } = hotkeys; michael@0: try { Object.defineProperty(hotkeys, 'Hotkey', { value: {} }); } catch(e) {} michael@0: assert.equal(hotkeys.Hotkey, Hotkey, "exports can't be redefined"); michael@0: }; michael@0: */ michael@0: michael@0: exports["test can't delete exported property"] = function(assert) { michael@0: let hotkeys = require("sdk/hotkeys"); michael@0: let { Hotkey } = hotkeys; michael@0: michael@0: try { delete hotkeys.Hotkey; } catch(e) {} michael@0: assert.equal(hotkeys.Hotkey, Hotkey, "exports can't be deleted"); michael@0: }; michael@0: michael@0: exports["test can't override exported property"] = function(assert) { michael@0: let hotkeys = require("sdk/hotkeys"); michael@0: let { Hotkey } = hotkeys; michael@0: michael@0: try { hotkeys.Hotkey = Object } catch(e) {} michael@0: assert.equal(hotkeys.Hotkey, Hotkey, "exports can't be overriden"); michael@0: }; michael@0: michael@0: require("test").run(exports);