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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <pre id="console"></pre>
8 <div style="width:800px; height:800px">
9 <textarea id="textInputID">
10 Some text
11 </textarea>
12 </div>
13 <script>
14 description("<b>Test for resizing the Textarea above minimum size set and below it's initial size.</b>");
15 updateSize();
16
17 function log(msg)
18 {
19 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
20 }
21
22 function updateSize()
23 {
24 if (window.testRunner) {
25 var textAreaElement = document.getElementById("textInputID");
26
27 textAreaElement.style.width = "400px";
28 textAreaElement.style.height = "400px";
29 textAreaElement.style.minWidth="200px";
30 textAreaElement.style.minHeight="200px";
31 testDragAndMove();
32
33 textAreaElement.style.width = "400px";
34 textAreaElement.style.height = "400px";
35 textAreaElement.style.minWidth="15vw";
36 textAreaElement.style.minHeight="15vh";
37 testDragAndMove();
38
39 textAreaElement.style.width = "400px";
40 textAreaElement.style.height = "400px";
41 textAreaElement.style.minWidth="10%";
42 textAreaElement.style.minHeight="10%";
43 testDragAndMove();
44
45 } else
46 log("\n\nThis test needs window.testRunner and window.eventSender to wor k. To manually test it, drag the textarea below. \nFor test to pass the width an d height of textarea should not go below min-width and min-height\n\n");
47 }
48
49 function testDragAndMove()
50 {
51 var startX = document.getElementById("textInputID").offsetLeft + 400;
52 var startY = document.getElementById("textInputID").offsetTop + 400;
53
54 eventSender.dragMode = false;
55 eventSender.mouseMoveTo(startX,startY);
56 eventSender.mouseDown();
57 // Then drag it.
58 eventSender.mouseMoveTo(startX - 150, startY - 150);
59 eventSender.mouseUp();
60
61 shouldBeEqualToString('document.getElementById("textInputID").style.width', '250px');
62 shouldBeEqualToString('document.getElementById("textInputID").style.height;' , '250px');
63 }
64 </script>
65 </body>
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698