| Index: third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html b/third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..80fe6587c17dc4e1fb29cfd83e62ed719e2ba058
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html
|
| @@ -0,0 +1,69 @@
|
| +<!DOCTYPE html>
|
| +<script src='../../resources/testharness.js'></script>
|
| +<script src='../../resources/testharnessreport.js'></script>
|
| +<style type="text/css">
|
| +#blue {
|
| + background-color: rgb(0, 0, 255);
|
| + position: absolute;
|
| + left: 75px;
|
| + top: 75px;
|
| + height: 100px;
|
| + width: 100px;
|
| +}
|
| +#blue:hover {
|
| + background-color: rgb(255, 255, 0);
|
| +}
|
| +</style>
|
| +
|
| +<body onload="loaded();">
|
| +
|
| +<script type="text/javascript">
|
| +var eventList = [];
|
| +var x = 100;
|
| +var y = 100;
|
| +
|
| +function addBlue() {
|
| + document.body.innerHTML += '<div id="blue"></div>';
|
| + var blue = document.getElementById("blue");
|
| + var events = ['mouseover', 'mousemove', 'mouseout', 'mouseenter', 'mouseleave'];
|
| + events.forEach(function (event) {
|
| + blue.addEventListener(event, validMouseEventsResult);
|
| + });
|
| +}
|
| +
|
| +function loaded() {
|
| + document.addEventListener('click', addBlue);
|
| +}
|
| +
|
| +function validMouseEventsResult(event) {
|
| + eventList.push(event.type);
|
| + testMouseOver.step(function () {
|
| + assert_equals(event.target.id, "blue");
|
| + assert_equals(getComputedStyle(event.target).backgroundColor, "rgb(255, 255, 0)");
|
| + if (event.type == "mouseenter") {
|
| + var result = eventList.join();
|
| + assert_true(result == 'mouseover,mouseenter');
|
| + testMouseOver.done();
|
| + }
|
| + });
|
| +
|
| +}
|
| +
|
| +function testMouseOverAddElement() {
|
| + if (window.chrome && chrome.gpuBenchmarking) {
|
| + var pointerActions =
|
| + [{source: "mouse",
|
| + actions: [
|
| + { name: "pointerDown", x: x, y: y },
|
| + { name: "pointerUp" }]}];
|
| + chrome.gpuBenchmarking.pointerActionSequence(pointerActions);
|
| + }
|
| +}
|
| +
|
| +var testMouseOver = async_test('Tests that the mouseover event is fired and the element has a hover effect when the element underneath the mouse cursor is changed.');
|
| +testMouseOverAddElement();
|
| +
|
| +</script>
|
| +</body>
|
| +
|
| +
|
|
|