WebKit Bugzilla
Attachment 360897 Details for
Bug 194175
: Rewrite and rebaseline smart copy paste tests to work on iOS and MacOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194175-20190201141748.patch (text/plain), 17.55 KB, created by
Megan Gardner
on 2019-02-01 14:17:48 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2019-02-01 14:17:48 PST
Size:
17.55 KB
patch
obsolete
>Subversion Revision: 240858 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8495db83da9758f0ddf774402a52ffe46bb8abe5..5deeeefcd8086930f26d2215585825ecf6fc5ae1 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,30 @@ >+2019-02-01 Megan Gardner <megan_gardner@apple.com> >+ >+ Rewrite and rebaseline smart copy paste tests to work on iOS and MacOS >+ https://bugs.webkit.org/show_bug.cgi?id=194175 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Using the functions committed in 194070 Ryosuke wrote, make the >+ smart copy paste tests run on both iOS and MacOS. >+ These tests will be turned on in 193786. >+ >+ * editing/editing.js: >+ (runEditingTestWithCallbackLogging): >+ (runDumpAsTextEditingTest): >+ * editing/pasteboard/smart-paste-001.html: >+ * editing/pasteboard/smart-paste-002-expected.txt: >+ * editing/pasteboard/smart-paste-002.html: >+ * editing/pasteboard/smart-paste-003.html: >+ * editing/pasteboard/smart-paste-004.html: >+ * editing/pasteboard/smart-paste-005-expected.txt: >+ * editing/pasteboard/smart-paste-005.html: >+ * editing/pasteboard/smart-paste-006-expected.txt: >+ * editing/pasteboard/smart-paste-006.html: >+ * editing/pasteboard/smart-paste-007.html: >+ * editing/pasteboard/smart-paste-008.html: >+ * platform/mac/editing/pasteboard/smart-paste-008-expected.txt: >+ > 2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com> > > REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE >diff --git a/LayoutTests/editing/editing.js b/LayoutTests/editing/editing.js >index 26d56a9c7c4251742bf9b89bf0161bcef9aba987..daa5f31c361669430a4341f12f82ed66efc6f268 100644 >--- a/LayoutTests/editing/editing.js >+++ b/LayoutTests/editing/editing.js >@@ -924,7 +924,17 @@ function runEditingTestWithCallbackLogging(enableCallbackLogging) { > var elem = document.getElementById("test"); > var selection = window.getSelection(); > selection.setPosition(elem, 0); >- editingTest(); >+ >+ const result = editingTest(); >+ >+ if (result instanceof Promise) { >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ result.then(() => { >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }); >+ } > } > > var dumpAsText = false; >@@ -942,7 +952,7 @@ function runDumpAsTextEditingTest(enableCallbacks) { > var elem = document.getElementById("test"); > var selection = window.getSelection(); > selection.setPosition(elem, 0); >- editingTest(); >+ const result = editingTest(); > > for (var i = 0; i < elementsForDumpingMarkupList.length; i++) > document.body.appendChild(elementsForDumpingMarkupList[i]); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-001.html b/LayoutTests/editing/pasteboard/smart-paste-001.html >index 461b86940b6b4c999fc65400c4043c6460d0bcb6..cffd89c6cbee2a3b0e3746f0d20e645f3e04fd17 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-001.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-001.html >@@ -39,10 +39,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-002-expected.txt b/LayoutTests/editing/pasteboard/smart-paste-002-expected.txt >index f90028fbca445dd7b7ed242580437766d9283e47..11a53b0ee603cfb8b66f89d7abedd81158bbb805 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-002-expected.txt >+++ b/LayoutTests/editing/pasteboard/smart-paste-002-expected.txt >@@ -1,9 +1,7 @@ > EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document > EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted >diff --git a/LayoutTests/editing/pasteboard/smart-paste-002.html b/LayoutTests/editing/pasteboard/smart-paste-002.html >index bc3cd7b71e68b2b1de15d1f474518c26c3c2fac4..89283b09abc8f66cf34f5a5e0c3b0b18ca7b18b8 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-002.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-002.html >@@ -39,13 +39,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft + target.offsetWidth / 2; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionBackwardByWordCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-003.html b/LayoutTests/editing/pasteboard/smart-paste-003.html >index 6e5a609e322bcbf7cd1cc3c497655d31f14b2909..5a0769548815bd8b640cc974e89fac5147304d19 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-003.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-003.html >@@ -40,10 +40,11 @@ test test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-004.html b/LayoutTests/editing/pasteboard/smart-paste-004.html >index f6515156ab9e1ffc19bc3df95cee298533cc3c70..0a914c5524d58ffc0bf7641b0dc81c4cb67e34a4 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-004.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-004.html >@@ -39,10 +39,11 @@ test test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > moveSelectionForwardByCharacterCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-005-expected.txt b/LayoutTests/editing/pasteboard/smart-paste-005-expected.txt >index b8aef4ecb95d42fc0625449ef04fb333dedb29f2..b06e9e887c093e155d439264b6e02f86fd71d462 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-005-expected.txt >+++ b/LayoutTests/editing/pasteboard/smart-paste-005-expected.txt >@@ -1,9 +1,7 @@ > EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document > EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >diff --git a/LayoutTests/editing/pasteboard/smart-paste-005.html b/LayoutTests/editing/pasteboard/smart-paste-005.html >index 799047b450c15261fd9ea126112a843373c2b0d7..f12f5e5fd83b46ca6e1915c367c5cf9b4fc61632 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-005.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-005.html >@@ -40,13 +40,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft + target.offsetWidth / 2; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionBackwardByWordCommand(); > moveSelectionForwardByCharacterCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-006-expected.txt b/LayoutTests/editing/pasteboard/smart-paste-006-expected.txt >index 6d192832ae4d08f36977ede5b6f5cbd53323c962..4074bd2c7cba03135e11dbaef5490282ddf2192d 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-006-expected.txt >+++ b/LayoutTests/editing/pasteboard/smart-paste-006-expected.txt >@@ -1,6 +1,7 @@ > EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document > EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >diff --git a/LayoutTests/editing/pasteboard/smart-paste-006.html b/LayoutTests/editing/pasteboard/smart-paste-006.html >index d2efa017f3ef4171c475f3c93666a8d95a07602b..66825a5fc856a2359203b14d0468a0c0ce85b344 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-006.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-006.html >@@ -40,11 +40,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- extendSelectionForwardByWordCommand(); >- cutCommand(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); cutCommand(); > typeCharacterCommand('-'); > typeCharacterCommand('-'); > moveSelectionBackwardByCharacterCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-007.html b/LayoutTests/editing/pasteboard/smart-paste-007.html >index 8b7de9d52a901e67ab4e4979dcf889d067843aab..457409f0a4df74a91bff4735526169323b148bc1 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-007.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-007.html >@@ -16,15 +16,13 @@ > .scenario:first-line { font-weight: bold; margin-bottom: 16px;} > .expected-results:first-line { font-weight: bold } > </style> >-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> >+<script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > cutCommand(); > typeCharacterCommand('.'); > typeCharacterCommand('.'); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-008.html b/LayoutTests/editing/pasteboard/smart-paste-008.html >index 37e10482fc55a98b5b5ba508809b4c4c39fb4adb..312902e628303df6dca780f7fb674c63a0875b2f 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-008.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-008.html >@@ -6,16 +6,20 @@ if (window.testRunner) > <p>A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word.</p> > <div id="test" contenteditable="true"><div>foo</div><div>x bar</div></div> > >-<script type="text/javascript" src="../editing.js"></script> >+<script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> >-var s = window.getSelection(); > var e = document.getElementById("test"); > >-setSelectionCommand(e, 0, e, 0); >-doubleClickAtSelectionStart(); >-copyCommand(); >-moveSelectionBackwardByCharacterCommand(); >-moveSelectionForwardByCharacterCommand(); >-extendSelectionForwardByLineCommand(); >-pasteCommand(); >+async function runTest() { >+ getSelection().setBaseAndExtent(e, 0, e, 0); >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); >+ copyCommand(); >+ moveSelectionBackwardByCharacterCommand(); >+ moveSelectionForwardByCharacterCommand(); >+ extendSelectionForwardByLineCommand(); >+ pasteCommand(); >+} >+ >+UIHelper.wait(runTest()); > </script> >diff --git a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt >index 1728d53ff5d1a44afe315c912b98c34f4b2e66f4..eef2cc70ad54df00c03d3a47ee2b6306443bb581 100644 >--- a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt >+++ b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt >@@ -1,9 +1,9 @@ > EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document > EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE >+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194175
:
360897
|
360908