015-1.html (596B)
1 <script> 2 onload = function() { 3 window.test_prop = 1; 4 parent.tests[0].step(function() {parent.assert_equals(test_prop, 1)}); 5 parent.tests[0].step(function() {parent.assert_equals(document.open(), document)}); 6 document.write("<script>test_prop = 2;<\/script>"); 7 document.close(); 8 parent.tests[0].step(function() {parent.assert_equals(test_prop, 2)}); 9 parent.tests[1].step(function() {parent.assert_equals(window.test_prop, 2)}); 10 parent.tests[2].step(function() {parent.assert_equals(get_this(), window)}); 11 parent.tests_done(); 12 }; 13 14 function get_this() { 15 return this; 16 } 17 </script>