chromium/third_party/blink/web_tests/http/tests/xmlhttprequest/xmlhttprequest-image-not-loaded-svg.svg

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd">
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <text x="0" y="20"> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=17897"> bug 17897 </a>:  Not Rendering Images Imported from XHTML Document </text>
    <text y="40"> You should see PASSED once. </text>
    <g style="visibility:hidden" id='image' y="60" width="250" height="50"> </g>
    <text y="80" id="console"/>
    <script type="text/ecmascript"> <![CDATA[
        var xhr = new XMLHttpRequest();
        var icon;
        function logSuccessOrFailure()
        {
            var console = document.getElementById('console');
            // If the image was loaded correctly, then height
            // and width are not zero.
            if (icon.height && icon.width)
                console.appendChild(document.createTextNode("PASSED"));
            else
                console.appendChild(document.createTextNode("FAILED"));

            if (window.testRunner)
                testRunner.notifyDone();
        }

        if (window.testRunner) {
            testRunner.dumpAsText();
            testRunner.waitUntilDone();
        }

        xhr.open('GET', 'resources/load-icon.svg');
        xhr.onreadystatechange = function()
        {
            if (xhr.readyState == 4) {
                var g = xhr.responseXML.getElementsByTagName('g')[0];
                try {
                    document.adoptNode(g);
                }
                catch(e){}

                icon = g.getElementsByTagName('image')[0];
                logSuccessOrFailure();

                document.getElementById('image').appendChild(g);
            }
        };
        xhr.send(null);
]]> </script>
</svg>