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

Unified Diff: LayoutTests/fast/events/mouse-cursor-style-change-iframe.html

Issue 1121433003: Fix mouse cursor update timer to be page-global instead of per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bokan cr feedback Created 5 years, 8 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 | LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
diff --git a/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html b/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..30b3a1adc8afcecbee6370e7046fe457f8c663cf
--- /dev/null
+++ b/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style type="text/css">
+ #container {
+ padding: 30px;
+ cursor: pointer;
+ border: 1px solid blue;
+ }
+ .wait {
+ cursor: wait !important;
+ }
+ iframe {
+ width: 300px;
+ }
+</style>
+</head>
+<body>
+<p id="description"></p>
+<div id="container">
+ <iframe id="frame" srcdoc="<body style='height: 500px; cursor: text;'></body>"></iframe>
+</div>
+<div id="console"></div>
+<script>
+ // Must be at least the value of cursorUpdateInterval from EventHandler.cpp
+ // which is used to throttle update requests.
+ var CURSOR_UPDATE_DELAY = 50;
+
+ description("Test that a cursor change that occurs due only to a style change correctly considers iframes.");
+
+ if (!window.eventSender) {
+ testFailed('This test requires DumpRenderTree');
+ }
+
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ window.jsTestIsAsync = true;
+ }
+
+ var container = document.getElementById('container');
+
+ var y;
+ var frame;
+
+ if (window.eventSender) {
+ debug('Mouse moved to cursor changing div');
+ eventSender.mouseMoveTo(100, container.offsetTop + 5);
+ debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document));
+ shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Hand hotSpot=0,0');
+
+ debug('Changing cursor style');
+ container.classList.add('wait');
+ setTimeout(function() {
+ shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Wait hotSpot=0,0');
+ debug('');
+
+ debug('Now move mouse onto iframe above cursor changing div');
+ frame = document.getElementById('frame');
+ y = frame.offsetTop + 10;
+ eventSender.mouseMoveTo(100, y);
+ shouldBe('document.elementFromPoint(100, y)', 'frame');
+ shouldBeTrue('document.elementsFromPoint(100, y).indexOf(container) > 0');
+ shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=IBeam hotSpot=0,0');
+ debug('');
+
+ debug('Changing cursor style of the background should not affect the cursor as it sits over the iframe');
+ container.classList.remove('wait');
+ setTimeout(function() {
+ shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=IBeam hotSpot=0,0');
+ finishJSTest();
+ }, CURSOR_UPDATE_DELAY);
+ }, CURSOR_UPDATE_DELAY);
+
+ } else {
+ function toggleCursorInMainFrame() {
+ container.classList.toggle('cursor');
+ requestAnimationFrame(toggleCursorInMainFrame);
+ }
+ requestAnimationFrame(toggleCursorInMainFrame);
+ }
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698