test_CCW_optimization.html (1179B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1319087 5 --> 6 <head> 7 <title>Test for Bug 1319087</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1319087">Mozilla Bug 1319087</a> 14 <p id="display"></p> 15 <div id="content"> 16 <iframe></iframe> 17 <iframe></iframe> 18 </div> 19 <pre id="test"> 20 <script type="text/javascript"> 21 22 function WrapperToOwnCompartment() { 23 var iframe = new frames[0].Object(); 24 var obj = iframe.obj = new Object(); 25 obj.x = 123; 26 27 for (var i = 0; i < 50; i++) { 28 is(iframe.obj, obj); 29 is(iframe.obj.x, 123); 30 } 31 } 32 33 function WrapperToYetAnotherCompartment() { 34 var iframe = new frames[0].Object(); 35 // Obj points to an object in a third compartment. 36 var obj = iframe.obj = new frames[1].Object(); 37 obj.x = 42; 38 39 for (var i = 0; i < 50; i++) { 40 is(iframe.obj, obj); 41 is(iframe.obj.x, 42); 42 } 43 } 44 45 WrapperToOwnCompartment(); 46 WrapperToYetAnotherCompartment(); 47 48 </script> 49 </body> 50 </html>