OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <form method="GET" target="target" id="form"> | |
8 <input name="query" value="AAA" pattern="banana|cherry" onfocus="onFocus(e vent)"/> | |
9 <input type="submit" id="submitButton"/> | |
10 </form> | |
11 <iframe id="target" name="target"></iframe> | |
12 <script> | |
13 description('Test that form.submit() when called on "focus" event for invalid fo rm should submit the form'); | |
14 var count = 1; | |
15 | |
16 function asyncTest(query) { | |
tkent
2014/04/01 02:23:15
This function and 'count' are unnecessary. We can
harpreet.sk
2014/04/01 05:46:07
Done.
| |
17 if (query === '?query=AAA') { | |
18 if (--count == 0) { | |
19 testPassed('Form is successfully submitted and content is loaded in the frame'); | |
20 finishJSTest(); | |
21 } | |
22 } | |
23 } | |
24 | |
25 function onFocus(event) { | |
26 var form = document.getElementById('form'); | |
27 form.action = '#foo'; | |
28 form.submit(); | |
29 } | |
30 | |
31 document.getElementById('target').onload = function(event) { | |
32 // This should return back query AAA | |
33 asyncTest(event.target.contentWindow.location.search); | |
34 } | |
35 | |
36 window.onload = function() { | |
37 document.getElementById('submitButton').click(); | |
38 } | |
39 | |
40 if (window.testRunner) | |
41 window.jsTestIsAsync = true; | |
42 </script> | |
43 </body> | |
44 </html> | |
OLD | NEW |