Title: [240934] trunk/Tools
Revision
240934
Author
[email protected]
Date
2019-02-04 10:59:40 -0800 (Mon, 04 Feb 2019)

Log Message

[iOS] API test WKAttachmentTests.InsertAndRemoveDuplicateAttachment is failing after r240902
https://bugs.webkit.org/show_bug.cgi?id=194207

Reviewed by Tim Horton.

Fix this API test by making it robust against smart paste on iOS. Currently, this test pastes an attachment
element and assumes that the pasted attachment is adjacent to the original one. However, after enabling smart
paste, we now insert an extra space in between. Instead of executing "DeleteBackward" twice to test removing the
attachment elements, we delete backwards once to remove the pasted attachment, and move the selection to the
start and delete forwards to remove the original attachment.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (240933 => 240934)


--- trunk/Tools/ChangeLog	2019-02-04 18:57:31 UTC (rev 240933)
+++ trunk/Tools/ChangeLog	2019-02-04 18:59:40 UTC (rev 240934)
@@ -1,3 +1,19 @@
+2019-02-04  Wenson Hsieh  <[email protected]>
+
+        [iOS] API test WKAttachmentTests.InsertAndRemoveDuplicateAttachment is failing after r240902
+        https://bugs.webkit.org/show_bug.cgi?id=194207
+
+        Reviewed by Tim Horton.
+
+        Fix this API test by making it robust against smart paste on iOS. Currently, this test pastes an attachment
+        element and assumes that the pasted attachment is adjacent to the original one. However, after enabling smart
+        paste, we now insert an extra space in between. Instead of executing "DeleteBackward" twice to test removing the
+        attachment elements, we delete backwards once to remove the pasted attachment, and move the selection to the
+        start and delete forwards to remove the original attachment.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
+        (TestWebKitAPI::TEST):
+
 2019-02-04  Youenn Fablet  <[email protected]>
 
         Capture state should be managed consistently when doing process swapping

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm (240933 => 240934)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm	2019-02-04 18:57:31 UTC (rev 240933)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm	2019-02-04 18:59:40 UTC (rev 240934)
@@ -1114,7 +1114,8 @@
     }
     {
         ObserveAttachmentUpdatesForScope observer(webView.get());
-        [webView _synchronouslyExecuteEditCommand:@"DeleteBackward" argument:nil];
+        [webView evaluateJavaScript:@"getSelection().setPosition(document.body)" completionHandler:nil];
+        [webView _synchronouslyExecuteEditCommand:@"DeleteForward" argument:nil];
         observer.expectAttachmentUpdates(@[ originalAttachment.get() ], @[ ]);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to