Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / loader / form-state-restore-with-frames.html
blob90ad073e96a6ff29ab3972e3a66247984e2cec48
1 <!DOCTYPE html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <meta http-equiv="pragma" content="no-cache">
5 <meta http-equiv="cache-control" content="no-cache">
6 </head>
7 <body onload="startTest()">
8 <input name="name1" id="input1">
9 <iframe id="frame1" src="resources/form-state-restore-with-frames-1.html">
10 </iframe>
11 <form id="form1" action="data:text/html,&lt;script>history.back();&lt;/script>">
12 <input type="submit">
13 </form>
15 <script>
16 function $(id) {
17 return document.getElementById(id);
19 function frame$(frame, id) {
20 return frame.contentDocument.getElementById(id);
23 function startTest() {
24 if ($('input1').value == 'visited') {
25 shouldBeEqualToString('frame$($("frame1"), "input2").value', 'value2');
26 shouldBeEqualToString('frame$(frame$($("frame1"), "frame2"), "input3").value', 'value3');
27 finishJSTest();
28 } else {
29 setTimeout(function() {
30 $('input1').value = 'visited';
31 frame$($('frame1'), 'input2').value = 'value2';
32 frame$(frame$($('frame1'), 'frame2'), 'input3').value = 'value3';
33 $('form1').submit();
34 }, 0);
38 jsTestIsAsync = true;
39 </script>
40 </body>