Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Force activating pixel tests - this variable is used in resources/js-test.js, when calling setDumpAsText(). | 1 // Force activating pixel tests - this variable is used in resources/js-test.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 if (window.testRunner) { | |
| 12 var s = document.createElement('style'); | |
| 13 s.innerHTML += ".running h1, .running pre, .running div#console, .running p { display:none }"; | |
| 14 s.innerHTML += "h1, pre, div#console, p { opacity: 0 }"; | |
| 15 s.innerHTML += "body { overflow: hidden }"; | |
| 16 document.head.appendChild(s); | |
| 17 document.head.parentNode.classList.add("running"); | |
|
jamesr
2014/02/19 21:40:19
dumb question: is there a better way to refer to t
| |
| 18 } | |
| 19 | |
| 20 function afterTest() { | |
| 21 document.head.parentNode.classList.remove("running"); | |
| 22 } | |
| 23 | |
| 11 function createSVGElement(name) { | 24 function createSVGElement(name) { |
| 12 return document.createElementNS(svgNS, "svg:" + name); | 25 return document.createElementNS(svgNS, "svg:" + name); |
| 13 } | 26 } |
| 14 | 27 |
| 15 function shouldHaveBBox(element, width, height) | 28 function shouldHaveBBox(element, width, height) |
| 16 { | 29 { |
| 17 shouldBe(element + ".getBBox().width", width); | 30 shouldBe(element + ".getBBox().width", width); |
| 18 shouldBe(element + ".getBBox().height", height); | 31 shouldBe(element + ".getBBox().height", height); |
| 19 } | 32 } |
| 20 | 33 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 if (window.eventSender) { | 70 if (window.eventSender) { |
| 58 eventSender.mouseMoveTo(x, y); | 71 eventSender.mouseMoveTo(x, y); |
| 59 eventSender.mouseDown(); | 72 eventSender.mouseDown(); |
| 60 eventSender.mouseUp(); | 73 eventSender.mouseUp(); |
| 61 } | 74 } |
| 62 } | 75 } |
| 63 | 76 |
| 64 function completeTest() { | 77 function completeTest() { |
| 65 finishJSTest(); | 78 finishJSTest(); |
| 66 } | 79 } |
| OLD | NEW |