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: const Cu = Components.utils; michael@0: function run_test() { michael@0: let unprivilegedSb = new Cu.Sandbox('http://www.example.com'); michael@0: function checkCantWrap(val) { michael@0: try { michael@0: unprivilegedSb.prop = val; michael@0: do_check_true(false); michael@0: } catch (e) { michael@0: do_check_true(/denied|insecure|/.test(e)); michael@0: } michael@0: } michael@0: let xoSb = new Cu.Sandbox('http://www.example.net'); michael@0: let epSb = new Cu.Sandbox(['http://www.example.com']); michael@0: checkCantWrap(eval); michael@0: checkCantWrap(xoSb.eval); michael@0: checkCantWrap(epSb.eval); michael@0: checkCantWrap(Function); michael@0: checkCantWrap(xoSb.Function); michael@0: checkCantWrap(epSb.Function); michael@0: }