1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/chrome/test_indexedSetter.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=715156 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 715156</title> 1.12 + <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> 1.14 + <script type="application/javascript"> 1.15 + 1.16 + /** Test for Bug 715156 **/ 1.17 + 1.18 + function runTests() { 1.19 + var doc = document.getElementById("testFrame").contentDocument; 1.20 + var options = doc.createElement("select").options; 1.21 + ok(Components.utils.isXrayWrapper(options), "should be an Xray wrapper"); 1.22 + var option = doc.createElement("option"); 1.23 + options[4] = option; 1.24 + is(options.length, 5, "setting an indexed property through an Xray wrapper should work") 1.25 + is(options[4], option, "setting an indexed property through an Xray wrapper should work") 1.26 + SimpleTest.finish(); 1.27 + } 1.28 + 1.29 + SimpleTest.waitForExplicitFinish(); 1.30 + addLoadEvent(runTests); 1.31 + 1.32 + </script> 1.33 +</head> 1.34 +<body> 1.35 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=715156">Mozilla Bug 715156</a> 1.36 +<p id="display"></p> 1.37 +<iframe id="testFrame"></iframe> 1.38 +<pre id="test"> 1.39 +</pre> 1.40 +</body> 1.41 +</html>