Bug 1042798 - Test: ensure window.open followed by document.writeln doesn't throw security error when called through NPN evaluate. r=bz, a=lmandel
authorBob Owen <bobowencode@gmail.com>
Mon, 28 Jul 2014 20:24:36 +0100
changeset 209289 55731dcb4b170451f31c923e8af8a475709fc785
parent 209288 74a868d4fccd6f601fd28a32c43a0cfe590499da
child 209290 3d310f9e5e5e8ad2ab35ee44a34c5abd45c25b7e
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lmandel
bugs1042798
milestone32.0
Bug 1042798 - Test: ensure window.open followed by document.writeln doesn't throw security error when called through NPN evaluate. r=bz, a=lmandel
dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
--- a/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
@@ -43,16 +43,17 @@
       ["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
       ["document.getElementById('display')", 
           document.getElementById("display")],
       ["encodeURI('a = b')", "a%20=%20b"],
       ["document.getElementById('testdiv').innerHTML = 'Hello world!'", 
           "Hello world!"],
       ["function test2() { var x = {a: '1', b: '2'}; return x; } test2();", 
           {a: '1', b: '2'}],
+      ["(function() { var ret; try { win = window.open(); win.document.writeln('wibble'); ret = 'no error' } catch(e) { ret = e.name; } win.close(); return ret; })()", "no error"],
     ];
 
     var plugin = document.getElementById("plugin1");
 
     // Test calling NPN_Evaluate from within plugin code.
     for (var test of tests) {
       var expected = test[1];
       var result = plugin.npnEvaluateTest(test[0]);