Test fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 23:33:03 +0000 (23:33 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 23:33:03 +0000 (23:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178759

Reviewed by Ryosuke Niwa.

Make use of typeCharacterCommand() from (LayoutTests/editing/editing.js) to type each character
with a delay and delay test completion until all characters have been typed.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
* fast/writing-mode/english-bt-text-with-spelling-marker.html:

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

LayoutTests/ChangeLog
LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker-expected.html
LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker.html

index 227a0f3..7ab5e5d 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-24  Daniel Bates  <dabates@apple.com>
+
+        Test fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for editing commands to complete
+        https://bugs.webkit.org/show_bug.cgi?id=178759
+
+        Reviewed by Ryosuke Niwa.
+
+        Make use of typeCharacterCommand() from (LayoutTests/editing/editing.js) to type each character
+        with a delay and delay test completion until all characters have been typed.
+
+        * fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
+        * fast/writing-mode/english-bt-text-with-spelling-marker.html:
+
 2017-10-24  Youenn Fablet  <youenn@apple.com>
 
         Enable service worker to use cache storage api
index c0e1364..65a66f8 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src="../../editing/editing.js"></script>
 <style>
 @font-face {
     font-family: Ahem;
@@ -28,8 +29,8 @@ typeText("mispelled a", expected);
 function typeText(text, element)
 {
     element.focus();
-    for (var i = 0; i < text.length; ++i)
-        document.execCommand("InsertText", false, text[i]);
+    for (const c of text)
+        typeCharacterCommand(c);
     element.blur();
 }
 </script>
index 6b9da45..423e376 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src="../../editing/editing.js"></script>
 <style>
 @font-face {
     font-family: Ahem;
@@ -32,8 +33,8 @@ typeText("a mispelled", test);
 function typeText(text, element)
 {
     element.focus();
-    for (var i = 0; i < text.length; ++i)
-        document.execCommand("InsertText", false, text[i]);
+    for (const c of text)
+        typeCharacterCommand(c);
     element.blur();
 }
 </script>