OLD | NEW |
1 // Force activating pixel tests - this variable is used in fast/js/resources/js-
test-pre.js, when calling setDumpAsText(). | 1 // Force activating pixel tests - this variable is used in fast/js/resources/js-
test-pre.js, when calling setDumpAsText(). |
2 window.enablePixelTesting = true; | 2 window.enablePixelTesting = true; |
3 | 3 |
4 var svgNS = "http://www.w3.org/2000/svg"; | 4 var svgNS = "http://www.w3.org/2000/svg"; |
5 var xlinkNS = "http://www.w3.org/1999/xlink"; | 5 var xlinkNS = "http://www.w3.org/1999/xlink"; |
6 var xhtmlNS = "http://www.w3.org/1999/xhtml"; | 6 var xhtmlNS = "http://www.w3.org/1999/xhtml"; |
7 | 7 |
8 var rootSVGElement; | 8 var rootSVGElement; |
9 var iframeElement; | 9 var iframeElement; |
10 | 10 |
11 function createSVGElement(name) { | 11 function createSVGElement(name) { |
12 return document.createElementNS(svgNS, "svg:" + name); | 12 return document.createElementNS(svgNS, "svg:" + name); |
13 } | 13 } |
14 | 14 |
| 15 function shouldHaveBBox(element, width, height) |
| 16 { |
| 17 shouldBe(element + ".getBBox().width", width); |
| 18 shouldBe(element + ".getBBox().height", height); |
| 19 } |
| 20 |
15 function createSVGTestCase() { | 21 function createSVGTestCase() { |
16 if (window.testRunner) | 22 if (window.testRunner) |
17 testRunner.waitUntilDone(); | 23 testRunner.waitUntilDone(); |
18 | 24 |
19 rootSVGElement = createSVGElement("svg"); | 25 rootSVGElement = createSVGElement("svg"); |
20 rootSVGElement.setAttribute("width", "300"); | 26 rootSVGElement.setAttribute("width", "300"); |
21 rootSVGElement.setAttribute("height", "300"); | 27 rootSVGElement.setAttribute("height", "300"); |
22 | 28 |
23 var bodyElement = document.documentElement.lastChild; | 29 var bodyElement = document.documentElement.lastChild; |
24 bodyElement.insertBefore(rootSVGElement, document.getElementById("descriptio
n")); | 30 bodyElement.insertBefore(rootSVGElement, document.getElementById("descriptio
n")); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 var script = document.createElement("script"); | 63 var script = document.createElement("script"); |
58 | 64 |
59 script.onload = function() { | 65 script.onload = function() { |
60 if (window.testRunner) | 66 if (window.testRunner) |
61 testRunner.notifyDone(); | 67 testRunner.notifyDone(); |
62 }; | 68 }; |
63 | 69 |
64 script.src = "../../fast/js/resources/js-test-post.js"; | 70 script.src = "../../fast/js/resources/js-test-post.js"; |
65 document.body.appendChild(script); | 71 document.body.appendChild(script); |
66 } | 72 } |
OLD | NEW |