<html>
<head>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText()
        testRunner.waitUntilDone();
    }

    function test() {
        var image = document.getElementById("testImage");
        var result = document.getElementById("result");

        if (image.width == 128 && image.height == 128)
            result.innerHTML = "PASS";
        else
            result.innerHTML = "FAIL";

        if (window.testRunner)
            testRunner.notifyDone();
    }
</script>
</head>
<body>
Tests that a subresource is loaded if the server expects an Accept
header to provide it.<br>
<img id="testImage" src="resources/image-checks-for-accept.py"  onload="test()" onerror="test()"/>
<div id="result"/>
</body>
</html>
