<html>
<head>
    <script src="../../resources/js-test-pre.js"></script>
    <script>
    function test() {
        var tf = document.getElementById('tf');

        var didFireOnChange = false;
        tf.onchange = function() {
          didFireOnChange = true;
        }

        if (window.testRunner) {
            testRunner.dumpAsText();
            testRunner.setValueForUser(tf, 'Hello!');
        }

        if (didFireOnChange) {
            testPassed('');
        } else {
            testFailed('onchange never fired')
        }
    }
    </script>
</head>
<body onload="test()">
    This tests that onchange correctly fires after calling setValueForUser().  It can only be run using DumpRenderTree.<br>
    <form name="fm">
        <input type="text" id="tf" />
    </form>
    <div id="console"></div>
</body>
</html>
