<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
    
    if (window.testRunner)
        testRunner.waitUntilDone();

    function rightFrameLoaded() {
        rightFrameLoadCount++;
        if (rightFrameLoadCount == 2) {
            // Console is set by runTest
            console.firstChild.nodeValue = "SUCCESS";

            if (window.testRunner) {
                // Put the test result in the main document so we can dump as text
                var text = console.ownerDocument.documentElement.innerHTML;
                document.open();
                document.write(text);
                document.close();

                testRunner.dumpAsText();
                testRunner.notifyDone();
            }
        }
    }

    function runTest() {
        console = document.getElementById("left_frame").contentWindow.document.getElementById("console");
        if (console.firstChild.nodeValue == "FAILURE") {
            console.firstChild.nodeValue = "PROCESSING...";
            document.getElementById("right_frame").src = "resources/purple.html";
        } else {
            alert('TEST FAILURE: Unexpected onload call')
        }
    }
    
    rightFrameLoadCount = 0;
</script>
</head>
<frameset onload="runTest()" cols="50%,*">
<frame id="left_frame" src="data:text/html,<body><p>Test for <a href='https://bugs.webkit.org/show_bug.cgi?id=3400'>bug 3400</a>: setting the .src of an iframe to the same value does not reload page.</p><p>Testing that setting an src of a frame to the same value works</p><p id=console>FAILURE</p></body>">
<frame id="right_frame" onload="javascript:rightFrameLoaded()" src="resources/purple.html"></frame>
</frameset>
</html>
