tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / forms / formtarget-attribute-button-html.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body onload="runTest()">
7 <form action="resources/success.txt" method="GET" target="failFrame">
8 <button type="submit" id="button" formtarget="passFrame">
9 </form>
10 <script>
11 description("Test for the formtarget attribute in a button tag.");
12
13 function runTest()
14 {
15     if (window.layoutTestController) {
16         layoutTestController.setAllowUniversalAccessFromFileURLs(true);
17         layoutTestController.waitUntilDone();
18     }
19
20     // Not dumping as text since the DumpRenderTree does not dump the text content of child frames.                
21     var button = document.getElementById('button');
22     button.click();
23 }
24
25 function passFrameLoaded()
26 {
27     if (document.getElementById('pass').contentDocument.URL == "about:blank")
28         return;
29     testPassed("The formtarget attribute was successfully used.");
30     isSuccessfullyParsed();
31     if (window.layoutTestController)
32         layoutTestController.notifyDone();
33 }
34
35 function failFrameLoaded()
36 {
37     if (document.getElementById('fail').contentDocument.URL == "about:blank")
38         return;
39     testFailed("The formtarget attribute was not used.");
40     isSuccessfullyParsed();
41     if (window.layoutTestController)
42         layoutTestController.notifyDone();
43 }
44 </script>
45 <iframe src="about:blank" id="pass" name="passFrame" onload="passFrameLoaded()"></iframe>
46 <iframe src="about:blank" id="fail" name="failFrame" onload="failFrameLoaded()"></iframe>
47 </body>
48 </html>