summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/formtarget-attribute-input-2.html
blob: 7a50df2c1705a93922ea256aac179ee364bd503b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<body onload="runTest()">
<script src="../../resources/js-test.js"></script>
<script src="resources/common.js"></script>
<form action="resources/success.txt" method="GET" target="failFrame">
<input type="submit" id="button" formtarget="passFrame">
</form>
<script>
description("Test for the formtarget attribute in an input tag.");

function runTest() {
    if (window.testRunner) {
        testRunner.setAllowUniversalAccessFromFileURLs(true);
        testRunner.waitUntilDone();
    }
    clickElement(document.getElementById('button'));
}

function passFrameLoaded() {
    if (document.getElementById('pass').contentDocument.URL == "about:blank")
        return;
    testPassed("The formtarget attribute was successfully used.");
    isSuccessfullyParsed();
    if (window.testRunner)
        testRunner.notifyDone();
}

function failFrameLoaded() {
    if (document.getElementById('fail').contentDocument.URL == "about:blank")
        return;
    testFailed("The formtarget attribute was not used.");
    isSuccessfullyParsed();
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
<iframe src="about:blank" id="pass" name="passFrame" onload="passFrameLoaded()"></iframe>
<iframe src="about:blank" id="fail" name="failFrame" onload="failFrameLoaded()"></iframe>
</body>
</html>