chromium/third_party/blink/web_tests/svg/custom/svg-allowed-in-dashboard-object.html

<html>
<body onload="runTest()">
<p>This test makes sure we can open SVG documents in Dashboard compatibility mode.  It can not be tested manually.</p>
<script>
    if (window.testRunner) {
        testRunner.setUseDashboardCompatibilityMode(true);
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }
   
    function debug(str) {
        var c = document.getElementById('console')
        c.appendChild(document.createTextNode(str + '\n'));
    }
   
    function runTest() {
        try {
            var failed = false;
            var svgDoc = null;
            try {
                svgDoc = document.getElementById('svgObject').getSVGDocument();
            } catch (e) {
                svgDoc = null;
            }
            if (svgDoc) {
                debug("PASS: Loaded SVG document in <object> tag.");
                failed = true;
            } else
                debug("FAIL: Did not load SVG document in <object> tag");
           
            try {
                svgDoc = document.getElementById('svgEmbed').getSVGDocument();
            } catch (e) {
                svgDoc = null;
            }
            if (svgDoc) {
                debug("PASS: Loaded SVG document in <element> tag.");
                failed = true;
            } else
                debug("FAIL: Did not load SVG document in <element> tag");
           
            try {
                svgDoc = document.getElementById('svgIFrame').getSVGDocument();
            } catch (e) {
                svgDoc = null;
            }
            if (svgDoc) {
                debug("PASS: Loaded SVG document in <iframe> tag.");
                failed = true;
            } else
                debug("FAIL: Did not load SVG document in <iframe> tag");
           
            if (failed)
                debug("PASS: SVG Documents were loaded");
            else
                debug("FAIL: SVG Documents were not loaded");
        } catch (e) {
            debug("FAIL: Exception thrown: " + e)
        }
        if (window.testRunner)
            testRunner.notifyDone();
    }
</script>
   
   <object id="svgObject" data="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></object>
   <embed id="svgEmbed" src="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></embed>
   <iframe id="svgIFrame" src="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></iframe>
   <pre id="console"></pre>   
</body>
</html>