Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html

Issue 2956023004: Add a flag to update hover effect when a layout is changed (Closed)
Patch Set: Remove pause in test Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
+
+
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698