summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_bug854558.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/xpconnect/tests/unit/test_bug854558.js')
-rw-r--r--js/xpconnect/tests/unit/test_bug854558.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/xpconnect/tests/unit/test_bug854558.js b/js/xpconnect/tests/unit/test_bug854558.js
new file mode 100644
index 000000000..d60d23a5b
--- /dev/null
+++ b/js/xpconnect/tests/unit/test_bug854558.js
@@ -0,0 +1,11 @@
+const Cu = Components.utils;
+function run_test() {
+
+ var chromeSB = new Cu.Sandbox(this);
+ var contentSB = new Cu.Sandbox('http://www.example.com');
+ Cu.evalInSandbox('this.foo = {a: 2}', chromeSB);
+ contentSB.foo = chromeSB.foo;
+ do_check_eq(Cu.evalInSandbox('foo.a', contentSB), undefined, "Default deny with no __exposedProps__");
+ Cu.evalInSandbox('this.foo.__exposedProps__ = {a: "r"}', chromeSB);
+ do_check_eq(Cu.evalInSandbox('foo.a', contentSB), 2, "works with __exposedProps__");
+}