The test input-paste-undo.html needs update to work properly
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 22:07:03 +0000 (22:07 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 22:07:03 +0000 (22:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71091

Reviewed by David Kilzer.

Update the test to select the text that needs to be copied
so that it effectively go in the pasteboard on execCommand.

The test now dumps result as text, testing if the height does not
change with the form edition.

* fast/forms/input-paste-undo-expected.txt: Added.
* fast/forms/input-paste-undo.html:
* platform/chromium-linux/fast/forms/input-paste-undo-expected.png: Removed.
* platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png: Removed.
* platform/chromium-mac/fast/forms/input-paste-undo-expected.png: Removed.
* platform/chromium-win/fast/forms/input-paste-undo-expected.png: Removed.
* platform/chromium-win/fast/forms/input-paste-undo-expected.txt: Removed.
* platform/efl/fast/forms/input-paste-undo-expected.txt: Removed.
* platform/gtk/fast/forms/input-paste-undo-expected.png: Removed.
* platform/gtk/fast/forms/input-paste-undo-expected.txt: Removed.
* platform/mac-leopard/fast/forms/input-paste-undo-expected.png: Removed.
* platform/mac/fast/forms/input-paste-undo-expected.png: Removed.
* platform/mac/fast/forms/input-paste-undo-expected.txt: Removed.
* platform/qt/fast/forms/input-paste-undo-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98886 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/input-paste-undo-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-paste-undo.html
LayoutTests/platform/chromium-linux/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/chromium-mac/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/input-paste-undo-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.txt [deleted file]
LayoutTests/platform/mac-leopard/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.txt [deleted file]
LayoutTests/platform/qt/fast/forms/input-paste-undo-expected.txt [deleted file]

index 626a3cabe2624aa5e7de7d2b6a7eaa5197eda1c2..1060549879365e5d1183b7cfef0348e963bb2ed7 100755 (executable)
@@ -1,3 +1,31 @@
+2011-10-31  Benjamin Poulain  <benjamin@webkit.org>
+
+        The test input-paste-undo.html needs update to work properly
+        https://bugs.webkit.org/show_bug.cgi?id=71091
+
+        Reviewed by David Kilzer.
+
+        Update the test to select the text that needs to be copied
+        so that it effectively go in the pasteboard on execCommand.
+
+        The test now dumps result as text, testing if the height does not
+        change with the form edition.
+
+        * fast/forms/input-paste-undo-expected.txt: Added.
+        * fast/forms/input-paste-undo.html:
+        * platform/chromium-linux/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/chromium-mac/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/chromium-win/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/chromium-win/fast/forms/input-paste-undo-expected.txt: Removed.
+        * platform/efl/fast/forms/input-paste-undo-expected.txt: Removed.
+        * platform/gtk/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/gtk/fast/forms/input-paste-undo-expected.txt: Removed.
+        * platform/mac-leopard/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/mac/fast/forms/input-paste-undo-expected.png: Removed.
+        * platform/mac/fast/forms/input-paste-undo-expected.txt: Removed.
+        * platform/qt/fast/forms/input-paste-undo-expected.txt: Removed.
+
 2011-10-31  Yury Semikhatsky  <yurys@chromium.org>
 
         window.onerror doesn't work with inline (attribute) scripts
diff --git a/LayoutTests/fast/forms/input-paste-undo-expected.txt b/LayoutTests/fast/forms/input-paste-undo-expected.txt
new file mode 100644 (file)
index 0000000..18fc1ce
--- /dev/null
@@ -0,0 +1,19 @@
+This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.getElementById("destination").value is ""
+PASS document.getElementById("destination").value is "Text to copy-paste-undo."
+PASS document.getElementById("source").clientHeight == initialClientHeight is true
+PASS window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight is true
+PASS document.getElementById("destination").value is ""
+PASS document.getElementById("source").clientHeight == initialClientHeight is true
+PASS window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+Text to copy-paste-undo.
+
index d10fabae336268cbbb2b0af3f4dbce782df380f6..931569b945c4b9886e6324f9f941914833be848a 100644 (file)
@@ -1,27 +1,43 @@
 <html>
 <head>
 <script src=../../editing/editing.js language="JavaScript" type="text/JavaScript" ></script>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<br></br>
+<div contenteditable id="source">Text to copy-paste-undo.</div>
+<input type="text" id="destination"></input>
+
 <script>
+description("This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically.");
+
+var selection = window.getSelection();
+var source = document.getElementById('source');
+selection.selectAllChildren(source);
+
+var initialClientHeight = source.clientHeight;
+var initialClientComputedHeight = window.getComputedStyle(source).height;
 
-function test()
-{ 
-    var res = "";
-    
-    document.getElementById('dv').focus();
-    copyCommand();
-    document.getElementById('tf').focus();
-    pasteCommand();
-    undoCommand();
-}
+copyCommand();
+document.getElementById('destination').focus();
+shouldBeEqualToString('document.getElementById("destination").value', '');
+
+pasteCommand();
+shouldBeEqualToString('document.getElementById("destination").value', 'Text to copy-paste-undo.');
+shouldBeTrue('document.getElementById("source").clientHeight == initialClientHeight');
+shouldBeTrue('window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight');
+
+undoCommand();
+shouldBeEqualToString('document.getElementById("destination").value', '');
+shouldBeTrue('document.getElementById("source").clientHeight == initialClientHeight');
+shouldBeTrue('window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight');
+
+successfullyParsed = true;
 
 </script>
-</head>
-<body onload="test()">
-This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When running manually, you have to paste and undo by hand.
-<br><br>
-<input type="text" id="tf"></input>
-<div contenteditable id="dv">Text to paste</div>
-<div id="result">
-</div>
+<script src="../js/resources/js-test-post.js"></script>
 </body>
 </html>
diff --git a/LayoutTests/platform/chromium-linux/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/chromium-linux/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index efb554b..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index 4dece0c..0000000
Binary files a/LayoutTests/platform/chromium-mac-leopard/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/chromium-mac/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index 0ca5e64..0000000
Binary files a/LayoutTests/platform/chromium-mac/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index a2a0561..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.txt b/LayoutTests/platform/chromium-win/fast/forms/input-paste-undo-expected.txt
deleted file mode 100644 (file)
index 7e3202f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x86
-        RenderText {#text} at (0,0) size 759x39
-          text run at (0,0) width 759: "This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When running manually, you"
-          text run at (0,20) width 200: "have to paste and undo by hand. "
-        RenderBR {BR} at (200,35) size 0x0
-        RenderBR {BR} at (0,40) size 0x19
-        RenderTextControl {INPUT} at (2,62) size 155x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,86) size 784x20
-        RenderText {#text} at (0,0) size 79x19
-          text run at (0,0) width 79: "Text to paste"
-      RenderBlock {DIV} at (0,106) size 784x0
-layer at (12,73) size 151x16
-  RenderBlock {DIV} at (2,3) size 151x16
-caret: position 0 of child 0 {DIV} of {#shadow-root} of child 4 {INPUT} of body
diff --git a/LayoutTests/platform/efl/fast/forms/input-paste-undo-expected.txt b/LayoutTests/platform/efl/fast/forms/input-paste-undo-expected.txt
deleted file mode 100644 (file)
index e5d177c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x90
-        RenderText {#text} at (0,0) size 776x38
-          text run at (0,0) width 776: "This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When running manually,"
-          text run at (0,19) width 236: "you have to paste and undo by hand. "
-        RenderBR {BR} at (236,34) size 0x0
-        RenderBR {BR} at (0,38) size 0x19
-        RenderTextControl {INPUT} at (2,59) size 195x29 [color=#202020]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,90) size 784x19
-        RenderText {#text} at (0,0) size 81x19
-          text run at (0,0) width 81: "Text to paste"
-      RenderBlock {DIV} at (0,109) size 784x0
-layer at (14,73) size 188x19
-  RenderBlock {DIV} at (4,6) size 188x19
-caret: position 0 of child 0 {DIV} of {#shadow-root} of child 4 {INPUT} of body
diff --git a/LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index de53590..0000000
Binary files a/LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.txt b/LayoutTests/platform/gtk/fast/forms/input-paste-undo-expected.txt
deleted file mode 100644 (file)
index e69cfb9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x86
-        RenderText {#text} at (0,0) size 776x38
-          text run at (0,0) width 776: "This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When running manually,"
-          text run at (0,19) width 236: "you have to paste and undo by hand. "
-        RenderBR {BR} at (236,34) size 0x0
-        RenderBR {BR} at (0,38) size 0x19
-        RenderTextControl {INPUT} at (2,59) size 194x25 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,86) size 784x19
-        RenderText {#text} at (0,0) size 81x19
-          text run at (0,0) width 81: "Text to paste"
-      RenderBlock {DIV} at (0,105) size 784x0
-layer at (13,70) size 188x19
-  RenderBlock {DIV} at (3,3) size 188x19
-caret: position 0 of child 0 {DIV} of {#shadow-root} of child 4 {INPUT} of body
diff --git a/LayoutTests/platform/mac-leopard/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/mac-leopard/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index e11b9ee..0000000
Binary files a/LayoutTests/platform/mac-leopard/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.png b/LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.png
deleted file mode 100644 (file)
index 8d4c23f..0000000
Binary files a/LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.txt b/LayoutTests/platform/mac/fast/forms/input-paste-undo-expected.txt
deleted file mode 100644 (file)
index 4a45f51..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x77
-        RenderText {#text} at (0,0) size 776x36
-          text run at (0,0) width 776: "This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When running manually,"
-          text run at (0,18) width 236: "you have to paste and undo by hand. "
-        RenderBR {BR} at (236,32) size 0x0
-        RenderBR {BR} at (0,36) size 0x18
-        RenderTextControl {INPUT} at (2,56) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,77) size 784x18
-        RenderText {#text} at (0,0) size 81x18
-          text run at (0,0) width 81: "Text to paste"
-      RenderBlock {DIV} at (0,95) size 784x0
-layer at (13,67) size 119x13
-  RenderBlock {DIV} at (3,3) size 119x13
-caret: position 0 of child 0 {DIV} of {#shadow-root} of child 4 {INPUT} of body
diff --git a/LayoutTests/platform/qt/fast/forms/input-paste-undo-expected.txt b/LayoutTests/platform/qt/fast/forms/input-paste-undo-expected.txt
deleted file mode 100644 (file)
index 3622b84..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x92
-        RenderText {#text} at (0,0) size 736x42
-          text run at (0,0) width 736: "This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically. When"
-          text run at (0,21) width 396: "running manually, you have to paste and undo by hand. "
-        RenderBR {BR} at (396,37) size 0x0
-        RenderBR {BR} at (0,42) size 0x21
-        RenderTextControl {INPUT} at (2,65) size 186x25
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,92) size 784x21
-        RenderText {#text} at (0,0) size 91x21
-          text run at (0,0) width 91: "Text to paste"
-      RenderBlock {DIV} at (0,113) size 784x0
-layer at (12,75) size 182x21
-  RenderBlock {DIV} at (2,2) size 182x21
-caret: position 0 of child 0 {DIV} of {#shadow-root} of child 4 {INPUT} of body