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

Unified Diff: LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html

Issue 24074002: Drag'n drop Autoscroll does not work properly on inner frames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Drag'n drop Autoscroll does not work properly on inner frames Created 7 years, 3 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/drag-and-drop-autoscroll-inner-frame-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html
diff --git a/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html b/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html
new file mode 100644
index 0000000000000000000000000000000000000000..76ccd3c8812a789793feb5075af7ff3855a5f7a5
--- /dev/null
+++ b/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html
@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<head>
+<style type="text/css">
+#scrollable {
+ height: 200px;
+ overflow: auto;
+ border: solid 3px #cc0000;
+ font-size: 80px;
+}
+</style>
+<script>
+
+var x, y, middleTermScrollOffset;
+var iframe, iframeDocument, draggable;
+
+function log(msg)
+{
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+}
+
+function setUpTest()
+{
+ if (!window.eventSender) {
+ log('Please run within DumpRenderTree');
+ return;
+ }
+
+ window.jsTestIsAsync = true;
+ setTimeout(testIt, 0);
+}
+
+function testIt()
+{
+ eventSender.dragMode = false;
+
+ iframe = document.getElementById('scrollable');
+ iframeDocument = iframe.contentDocument;
+ draggable = iframeDocument.getElementById('draggable');
+
+ iframeDocument.addEventListener("scroll", recordScroll);
+
+ // Grab draggable.
+ x = iframe.offsetLeft + draggable.offsetLeft + 7;
+ y = iframe.offsetTop + draggable.offsetTop + 7;
+
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+
+ // Move mouse to the bottom autoscroll border belt.
+ y = iframe.offsetTop + iframe.offsetHeight - 10;
+ eventSender.mouseMoveTo(x, y);
+}
+
+function recordScroll(e)
+{
+ autoscrollTestPart1();
+ iframeDocument.removeEventListener("scroll", recordScroll);
+}
+
+function recordScroll2(e)
+{
+ autoscrollTestPart2();
+ iframeDocument.removeEventListener("scroll", recordScroll);
+}
+
+function autoscrollTestPart1()
+{
+ if (iframe.contentDocument.body.scrollTop == 0) {
+ testFailed("Autoscroll should have scrolled the iframe downwards, but did not");
+ finishTest();
+ return;
+ }
+
+ testPassed("Autoscroll should have scrolled the iframe downwards, and did.");
+
+ middleTermScrollOffset = iframe.contentDocument.body.scrollTop;
+ iframeDocument.addEventListener("scroll", recordScroll2);
+
+ // Move mouse to the upper autoscroll border belt.
+ y = iframe.offsetTop + 10;
+ eventSender.mouseMoveTo(x, y);
+}
+
+function autoscrollTestPart2()
+{
+ shouldBeTrue("iframe.contentDocument.body.scrollTop < middleTermScrollOffset")
+ finishTest();
+}
+
+function finishTest()
+{
+ eventSender.mouseUp();
+ finishJSTest();
+}
+
+var successfullyParsed = true;
+</script>
+</head>
+<body>
+For manual testing, drag and drop "Drop Me" downwards and then upwards.
+<iframe id="scrollable" src="data:text/html,
+<p id='draggable' draggable='true' style='cursor: hand;'>
+ <b>Drag me!</b>
+</p>
+Try to drag and drop the text above in the input element at the bottom of this iframe. It should scroll. Then, try the way back.
+<br><br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br>more<br><input>
+"></iframe><br>
+</div>
+<div id="console"></div>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+description('Check autoscroll within an inner frame by drag-and-drop');
+setUpTest();
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698