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 208205 55731dcb4b17
parent 208204 74a868d4fccd
child 208206 3d310f9e5e5e
push id3766
push userryanvm@gmail.com
push date2014-07-31 12:52 +0000
treeherdermozilla-beta@55731dcb4b17 [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]);