Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / svg-allowed-in-dashboard-object.html
blob57017bccbdf853efb31f5d4a624bc467052928c9
1 <html>
2 <body onload="runTest()">
3 <p>This test makes sure we can open SVG documents in Dashboard compatibility mode. It can not be tested manually.</p>
4 <script>
5 if (window.testRunner) {
6 testRunner.setUseDashboardCompatibilityMode(true);
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 function debug(str) {
12 var c = document.getElementById('console')
13 c.appendChild(document.createTextNode(str + '\n'));
16 function runTest() {
17 try {
18 var failed = false;
19 var svgDoc = null;
20 try {
21 svgDoc = document.getElementById('svgObject').getSVGDocument();
22 } catch (e) {
23 svgDoc = null;
25 if (svgDoc) {
26 debug("PASS: Loaded SVG document in <object> tag.");
27 failed = true;
28 } else
29 debug("FAIL: Did not load SVG document in <object> tag");
31 try {
32 svgDoc = document.getElementById('svgEmbed').getSVGDocument();
33 } catch (e) {
34 svgDoc = null;
36 if (svgDoc) {
37 debug("PASS: Loaded SVG document in <element> tag.");
38 failed = true;
39 } else
40 debug("FAIL: Did not load SVG document in <element> tag");
42 try {
43 svgDoc = document.getElementById('svgIFrame').getSVGDocument();
44 } catch (e) {
45 svgDoc = null;
47 if (svgDoc) {
48 debug("PASS: Loaded SVG document in <iframe> tag.");
49 failed = true;
50 } else
51 debug("FAIL: Did not load SVG document in <iframe> tag");
53 if (failed)
54 debug("PASS: SVG Documents were loaded");
55 else
56 debug("FAIL: SVG Documents were not loaded");
57 } catch (e) {
58 debug("FAIL: Exception thrown: " + e)
60 if (window.testRunner)
61 testRunner.notifyDone();
63 </script>
65 <object id="svgObject" data="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></object>
66 <embed id="svgEmbed" src="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></embed>
67 <iframe id="svgIFrame" src="../W3C-SVG-1.1/text-ws-02-t.svg" width="100px" height="100px"></iframe>
68 <pre id="console"></pre>
69 </body>
70 </html>