Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / select-options-remove-gc.html
blobbc845fd41971a842799b131b8ced13b66ddb3fc2
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div>
8 <select id="myselect">
9 <option>A</option>
10 <option>B</option>
11 <option>C</option>
12 </select>
13 </div>
14 <script>
15 description("This test checks that removing a &lt;select&gt; object from the DOM, then garbage collecting, then removing an option from select.options doesn't crash.");
17 var select = document.getElementById("myselect");
18 var options = select.options;
19 select.parentNode.removeChild(select);
20 select = null;
22 // create lots of objects to force a garbage collection
23 var i = 0;
24 var s;
25 while (i < 5000) {
26 i = i+1.11;
27 s = s + " ";
30 options.remove(0);
31 testPassed("No crash");
32 </script>
33 </body>
34 </html>