OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="../resources/common.js"></script> | 5 <script src="../resources/common.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p>Test if selected options are correctly restored even if their positions were
changed.</p> | 8 <p>Test if selected options are correctly restored even if their positions were
changed.</p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 | 10 |
11 <input id="emptyOnFirstVisit"> | 11 <input id="emptyOnFirstVisit"> |
12 <div id="parent"> | 12 <div id="parent"> |
13 <form action="data:text/html,<script>history.back()</script>" id=form1> | 13 <form action="../../../resources/back.html" id=form1> |
14 <select id="select1" multiple> | 14 <select id="select1" multiple> |
15 <option id="opt-ca-1" value="CA">California 1</option> | 15 <option id="opt-ca-1" value="CA">California 1</option> |
16 <option id="opt-ca-2" value="CA" selected>California 2</option> | 16 <option id="opt-ca-2" value="CA" selected>California 2</option> |
17 <option id="opt-la">LA</option> | 17 <option id="opt-la">LA</option> |
18 <optgroup> | 18 <optgroup> |
19 <option id="opt-tk" selected>Tokyo</option> | 19 <option id="opt-tk" selected>Tokyo</option> |
20 <option id="opt-os">Osaka</option> | 20 <option id="opt-os">Osaka</option> |
21 </optgroup> | 21 </optgroup> |
22 <option id="opt-ak" value="AK">Alaska</option> | 22 <option id="opt-ak" value="AK">Alaska</option> |
23 <option id="opt-wy" selected>WY</option> | 23 <option id="opt-wy" selected>WY</option> |
(...skipping 24 matching lines...) Expand all Loading... |
48 }, 0); | 48 }, 0); |
49 } else { | 49 } else { |
50 // Went back to this page again, and form state should be restored. | 50 // Went back to this page again, and form state should be restored. |
51 shouldBeFalse('$("opt-la").selected'); | 51 shouldBeFalse('$("opt-la").selected'); |
52 shouldBeFalse('$("opt-tk").selected'); | 52 shouldBeFalse('$("opt-tk").selected'); |
53 shouldBeTrue('$("opt-os").selected'); | 53 shouldBeTrue('$("opt-os").selected'); |
54 shouldBeFalse('$("opt-ak").selected'); | 54 shouldBeFalse('$("opt-ak").selected'); |
55 shouldBeFalse('$("opt-wy").selected'); | 55 shouldBeFalse('$("opt-wy").selected'); |
56 debug('We don\'t care which one is selected because their values are ide
ntical:'); | 56 debug('We don\'t care which one is selected because their values are ide
ntical:'); |
57 shouldBeTrue('!!($("opt-ca-1").selected ^ $("opt-ca-2").selected)'); | 57 shouldBeTrue('!!($("opt-ca-1").selected ^ $("opt-ca-2").selected)'); |
58 | 58 |
59 $('parent').innerHTML = ''; | 59 $('parent').innerHTML = ''; |
60 setTimeout(function() { | 60 setTimeout(function() { |
61 finishJSTest(); | 61 finishJSTest(); |
62 }, 0); | 62 }, 0); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 window.onload = runTest; | 66 window.onload = runTest; |
67 </script> | 67 </script> |
68 </body> | 68 </body> |
OLD | NEW |