| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 #red { | 5 #red { |
| 6 background-color: red; | 6 background-color: red; |
| 7 position: absolute; | 7 position: absolute; |
| 8 left: 50px; | 8 left: 50px; |
| 9 top: 50px; | 9 top: 50px; |
| 10 height: 100px; | 10 height: 100px; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 initialHoverOverRedDiv(); | 64 initialHoverOverRedDiv(); |
| 65 | 65 |
| 66 debug("Mouse is visible, deleting the red div."); | 66 debug("Mouse is visible, deleting the red div."); |
| 67 eventSender.keyDown("a"); | 67 eventSender.keyDown("a"); |
| 68 window.setTimeout(testAfterDeleteCursorVisible, 0); | 68 window.setTimeout(testAfterDeleteCursorVisible, 0); |
| 69 } | 69 } |
| 70 | 70 |
| 71 function testAfterDeleteCursorVisible() | 71 function testAfterDeleteCursorVisible() |
| 72 { | 72 { |
| 73 checkBlueHoverContent(blueTextWhenHovered); | 73 checkBlueHoverText(blueTextWhenHovered); |
| 74 window.setTimeout(testWithInvisibleCursor, 0); | 74 window.setTimeout(testWithInvisibleCursor, 0); |
| 75 } | 75 } |
| 76 | 76 |
| 77 function testWithInvisibleCursor() | 77 function testWithInvisibleCursor() |
| 78 { | 78 { |
| 79 blueDiv.parentNode.removeChild(blueDiv); | 79 blueDiv.parentNode.removeChild(blueDiv); |
| 80 insertDivs(); | 80 insertDivs(); |
| 81 | 81 |
| 82 initialHoverOverRedDiv(); | 82 initialHoverOverRedDiv(); |
| 83 | 83 |
| 84 debug("Setting the mouse cursor to be invisible."); | 84 debug("Setting the mouse cursor to be invisible."); |
| 85 internals.setIsCursorVisible(document, false); | 85 internals.setIsCursorVisible(document, false); |
| 86 shouldBeEqualToString("redDiv.innerHTML", redTextWhenHovered); | 86 shouldBeEqualToString("redDiv.innerHTML", redTextWhenHovered); |
| 87 shouldBeEqualToString("blueDiv.innerHTML", blueTextWhenNotHovered); | 87 shouldBeEqualToString("blueDiv.innerHTML", blueTextWhenNotHovered); |
| 88 | 88 |
| 89 debug("Mouse is invisible, deleting the red div."); | 89 debug("Mouse is invisible, deleting the red div."); |
| 90 eventSender.keyDown("a"); | 90 eventSender.keyDown("a"); |
| 91 window.setTimeout(testAfterDeleteCursorInvisible, 0); | 91 window.setTimeout(testAfterDeleteCursorInvisible, 0); |
| 92 } | 92 } |
| 93 | 93 |
| 94 function testAfterDeleteCursorInvisible() | 94 function testAfterDeleteCursorInvisible() |
| 95 { | 95 { |
| 96 checkBlueHoverContent("none"); | 96 checkBlueHoverText(blueTextWhenNotHovered); |
| 97 testRunner.notifyDone(); | 97 testRunner.notifyDone(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 | 100 |
| 101 // Helper functions | 101 // Helper functions |
| 102 | 102 |
| 103 function checkBlueHoverContent(expectedText) | 103 function checkBlueHoverText(expectedText) |
| 104 { | 104 { |
| 105 shouldBe("blueDiv.offsetTop", "50"); | 105 shouldBe("blueDiv.offsetTop", "50"); |
| 106 blueText = window.getComputedStyle(document.querySelector('#blue'), ':after'
).content; | 106 blueText = window.getComputedStyle(document.querySelector('#blue'), ':after'
).content; |
| 107 shouldBeEqualToString("blueText", expectedText); | 107 shouldBeEqualToString("blueText", expectedText); |
| 108 } | 108 } |
| 109 | 109 |
| 110 function insertDivs() | 110 function insertDivs() |
| 111 { | 111 { |
| 112 debug("Adding the red and blue divs."); | 112 debug("Adding the red and blue divs."); |
| 113 blueDiv.style.top = "200px"; | 113 blueDiv.style.top = "200px"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 131 </script> | 131 </script> |
| 132 | 132 |
| 133 <div id="container"> | 133 <div id="container"> |
| 134 </div> | 134 </div> |
| 135 | 135 |
| 136 <p>Test for <a href="http://crbug.com/240722">http://crbug.com/240722</a>. If th
e mouse cursor is not visible, no new hover effects should be invoked when the c
urrently hovered node is removed from the DOM. Press any key to delete the red d
iv.</p> | 136 <p>Test for <a href="http://crbug.com/240722">http://crbug.com/240722</a>. If th
e mouse cursor is not visible, no new hover effects should be invoked when the c
urrently hovered node is removed from the DOM. Press any key to delete the red d
iv.</p> |
| 137 | 137 |
| 138 <div id="console"></div> | 138 <div id="console"></div> |
| 139 </body> | 139 </body> |
| 140 </html> | 140 </html> |
| OLD | NEW |