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

Unified Diff: LayoutTests/fast/forms/textarea-resize-above-min-size-set-and-below-initial-size.html

Issue 239983004: Textarea resize-able only to larger; min-height and min-width properly set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and added shouldBeEqualToString() instead of shouldBe() in LayoutTest Created 6 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
Index: LayoutTests/fast/forms/textarea-resize-above-min-size-set-and-below-initial-size.html
diff --git a/LayoutTests/fast/forms/textarea-resize-above-min-size-set-and-below-initial-size.html b/LayoutTests/fast/forms/textarea-resize-above-min-size-set-and-below-initial-size.html
new file mode 100644
index 0000000000000000000000000000000000000000..4137f501cbe2ddaf01b1121c8dd72841b38aa5cb
--- /dev/null
+++ b/LayoutTests/fast/forms/textarea-resize-above-min-size-set-and-below-initial-size.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<pre id="console"></pre>
+<div style="width:800px; height:800px">
+<textarea id="textInputID">
+Some text
+</textarea>
+</div>
+<script>
+description("<b>Test for resizing the Textarea above minimum size set and below it's initial size.</b>");
+updateSize();
+
+function log(msg)
+{
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+}
+
+function updateSize()
+{
+ if (window.testRunner) {
+ var textAreaElement = document.getElementById("textInputID");
+
+ textAreaElement.style.width = "400px";
+ textAreaElement.style.height = "400px";
+ textAreaElement.style.minWidth="200px";
+ textAreaElement.style.minHeight="200px";
+ testDragAndMove();
+
+ textAreaElement.style.width = "400px";
+ textAreaElement.style.height = "400px";
+ textAreaElement.style.minWidth="15vw";
+ textAreaElement.style.minHeight="15vh";
+ testDragAndMove();
+
+ textAreaElement.style.width = "400px";
+ textAreaElement.style.height = "400px";
+ textAreaElement.style.minWidth="10%";
+ textAreaElement.style.minHeight="10%";
+ testDragAndMove();
+
+ } else
+ log("\n\nThis test needs window.testRunner and window.eventSender to work. To manually test it, drag the textarea below. \nFor test to pass the width and height of textarea should not go below min-width and min-height\n\n");
+}
+
+function testDragAndMove()
+{
+ var startX = document.getElementById("textInputID").offsetLeft + 400;
+ var startY = document.getElementById("textInputID").offsetTop + 400;
+
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(startX,startY);
+ eventSender.mouseDown();
+ // Then drag it.
+ eventSender.mouseMoveTo(startX - 150, startY - 150);
+ eventSender.mouseUp();
+
+ shouldBeEqualToString('document.getElementById("textInputID").style.width', '250px');
+ shouldBeEqualToString('document.getElementById("textInputID").style.height;', '250px');
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698