OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description("Tests that HTMLFrameElement and HTMLIFrameElement expose a getSVG
Document accessor"); | 10 description("Tests that HTMLFrameElement and HTMLIFrameElement expose a getSVG
Document accessor"); |
11 | 11 |
| 12 window.jsTestIsAsync = true; |
12 if (window.testRunner) | 13 if (window.testRunner) |
13 testRunner.waitUntilDone(); | 14 testRunner.waitUntilDone(); |
14 | 15 |
15 var frame; | 16 var frame; |
16 var iframe; | 17 var iframe; |
17 var embed; | 18 var embed; |
18 var object; | 19 var object; |
19 | 20 |
20 function startTest() { | 21 function startTest() { |
21 frame = document.createElement("frame"); | 22 frame = document.createElement("frame"); |
22 frame.onload = continueTest1; | 23 frame.onload = continueTest1; |
23 frame.src = "resources/getsvgdocument.svg"; | 24 frame.src = "resources/getsvgdocument.svg"; |
24 document.documentElement.appendChild(frame); | 25 document.documentElement.appendChild(frame); |
25 shouldBeTrue("!!frame.getSVGDocument"); | 26 shouldBeTrue("!!frame.getSVGDocument"); |
26 } | 27 } |
27 | 28 |
28 var continueTest1 = function() { | 29 var continueTest1 = function() { |
29 shouldBeEqualToString("frame.getSVGDocument().toString()", "[object SVGDocum
ent]"); | 30 shouldBeEqualToString("frame.getSVGDocument().toString()", "[object SVGDocum
ent]"); |
30 frame.parentNode.removeChild(frame); | 31 frame.parentNode.removeChild(frame); |
31 | 32 |
32 iframe = document.createElement("iframe"); | 33 iframe = document.createElement("iframe"); |
33 iframe.onload = continueTest2; | 34 iframe.onload = continueTest2; |
34 iframe.src = "resources/getsvgdocument.svg"; | 35 iframe.src = "resources/getsvgdocument.svg"; |
35 document.documentElement.appendChild(iframe); | 36 document.documentElement.appendChild(iframe); |
36 shouldBeTrue("!!iframe.getSVGDocument"); | 37 shouldBeTrue("!!iframe.getSVGDocument"); |
37 } | 38 } |
38 | 39 |
39 var continueTest2 = function() { | 40 var continueTest2 = function() { |
40 shouldBeEqualToString("iframe.getSVGDocument().toString()", "[object SVGDocu
ment]"); | 41 shouldBeEqualToString("iframe.getSVGDocument().toString()", "[object SVGDocu
ment]"); |
41 iframe.parentNode.removeChild(iframe); | 42 iframe.parentNode.removeChild(iframe); |
42 | 43 |
43 embed = document.createElement("embed"); | 44 embed = document.createElement("embed"); |
44 embed.onload = continueTest3; | 45 embed.onload = continueTest3; |
45 embed.src = "resources/getsvgdocument.svg"; | 46 embed.src = "resources/getsvgdocument.svg"; |
46 document.documentElement.appendChild(embed); | 47 document.documentElement.appendChild(embed); |
47 shouldBeTrue("!!embed.getSVGDocument"); | 48 shouldBeTrue("!!embed.getSVGDocument"); |
48 } | 49 } |
49 | 50 |
50 var continueTest3 = function(event) { | 51 var continueTest3 = function(event) { |
51 shouldBeEqualToString("embed.getSVGDocument().toString()", "[object SVGDocum
ent]"); | 52 shouldBeEqualToString("embed.getSVGDocument().toString()", "[object SVGDocum
ent]"); |
52 embed.parentNode.removeChild(embed); | 53 embed.parentNode.removeChild(embed); |
53 | 54 |
54 object = document.createElement("object"); | 55 object = document.createElement("object"); |
55 object.onload = continueTest4; | 56 object.onload = continueTest4; |
56 object.data = "resources/getsvgdocument.svg"; | 57 object.data = "resources/getsvgdocument.svg"; |
57 document.documentElement.appendChild(object); | 58 document.documentElement.appendChild(object); |
58 shouldBeTrue("!!object.getSVGDocument"); | 59 shouldBeTrue("!!object.getSVGDocument"); |
59 } | 60 } |
60 | 61 |
61 function continueTest4() { | 62 function continueTest4() { |
62 shouldBeEqualToString("object.getSVGDocument().toString()", "[object SVGDocu
ment]"); | 63 shouldBeEqualToString("object.getSVGDocument().toString()", "[object SVGDocu
ment]"); |
63 object.parentNode.removeChild(object); | 64 object.parentNode.removeChild(object); |
64 | 65 |
65 var script = document.createElement('script'); | 66 finishJSTest(); |
66 script.src = "../../fast/js/resources/js-test-post.js"; | |
67 script.onload = completeTest; | |
68 document.body.appendChild(script); | |
69 } | 67 } |
70 | 68 |
71 function completeTest() { | |
72 if (window.testRunner) | |
73 testRunner.notifyDone(); | |
74 } | |
75 | |
76 startTest(); | 69 startTest(); |
77 </script> | 70 </script> |
78 </body> | 71 </body> |
79 </html> | 72 </html> |
OLD | NEW |