<body>
    <svg width="100" height="100">
        <image width="100%" height="100%"/>
    </svg>
    <div id="log"></div>
    <script>
        function loadImage(href) {
            return new Promise((resolve) => {
                let image = document.querySelector('image');
                image.onload = (() => {
                    resolve();
                });
                image.setAttribute("href", href);
            });
        }

        if (window.testRunner)
            testRunner.waitUntilDone();

        loadImage("resources/green-checker.png").then(() => {
            loadImage("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='green'/></svg>").then(() => {
                if (window.testRunner)
                    testRunner.notifyDone();
            });
        });
    </script>
</body>
