Add a test that inserting a character inside a URL doesn't move caret per auto correction
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 00:57:03 +0000 (00:57 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 00:57:03 +0000 (00:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116458

Reviewed by Darin Adler.

Add a test. This is broken on Safari 6 but fixed on ToT.

* editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt: Added.
* editing/inserting/inserting-slash-inside-url-with-smart-link.html: Added.
* platform/mac-wk2/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link.html [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations

index 5f5bb137467e75f6cb7ff939b10f75664fda2ff2..176bd13b0863e2cac4d58335c728f9ab2548e3b5 100644 (file)
@@ -1,3 +1,16 @@
+2013-05-20  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Add a test that inserting a character inside a URL doesn't move caret per auto correction
+        https://bugs.webkit.org/show_bug.cgi?id=116458
+
+        Reviewed by Darin Adler.
+
+        Add a test. This is broken on Safari 6 but fixed on ToT.
+
+        * editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt: Added.
+        * editing/inserting/inserting-slash-inside-url-with-smart-link.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2013-05-20  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [GTK][WK2] Unflag tests related to layoutTestController.setSmartInsertDeleteEnabled
diff --git a/LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt b/LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt
new file mode 100644 (file)
index 0000000..f7e4f51
--- /dev/null
@@ -0,0 +1,9 @@
+Test inserting a character inside a URL with both smart quote and smart link doesn't move the caret to the end of text To manually run this test, enable "Check Spelling While Typing", "Smart Link", and "Smart Quotes", and insert a character inside the URL
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS caretOffset = editor.selectionStart; caretOffset is editor.selectionEnd
+PASS editor.selectionStart is caretOffset + 1
+PASS editor.selectionEnd is caretOffset + 1
+
diff --git a/LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link.html b/LayoutTests/editing/inserting/inserting-slash-inside-url-with-smart-link.html
new file mode 100644 (file)
index 0000000..4547622
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<body>
+<textarea id="editor" cols="50" rows="5">
+</textarea>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    internals.setAutomaticLinkDetectionEnabled(true);
+    internals.setAutomaticQuoteSubstitutionEnabled(true);
+}
+
+description('Test inserting a character inside a URL with both smart quote and smart link doesn\'t move the caret to the end of text\n'
+    + 'To manually run this test, enable "Check Spelling While Typing", "Smart Link", and "Smart Quotes", and insert a character inside the URL');
+
+var editor = document.getElementById('editor');
+editor.focus();
+document.execCommand('InsertText', false, 'Why don\u2019t you take a look at https:/webkit.org/');
+for (var i = 0; i < 'webkit.org/'.length; i++)
+    getSelection().modify('move', 'backward', 'character');
+shouldBe('caretOffset = editor.selectionStart; caretOffset', 'editor.selectionEnd');
+
+document.execCommand('InsertText', false, '/');
+
+shouldBe('editor.selectionStart', 'caretOffset + 1');
+shouldBe('editor.selectionEnd', 'caretOffset + 1');
+
+editor.style.display = 'none';
+
+</script>
+</body>
+</html>
index 53eb39fb98ca4bd18c5d6f1c0b4d780fee543b42..0f172ea4a089af0543cb110088157bee709e69e5 100644 (file)
@@ -1361,6 +1361,7 @@ webkit.org/b/83704 media/event-attributes.html [ Failure ]
 
 # EFL's LayoutTestController does not implement setAutomaticLinkDetectionEnabled
 webkit.org/b/85463 editing/inserting/typing-space-to-trigger-smart-link.html
+webkit.org/b/85463 editing/inserting/smart-link-when-caret-is-moved-before-URL.html
 
 # Tests failing due to rounding problems in colors inside pixman
 webkit.org/b/49964 fast/canvas/canvas-fillPath-shadow.html [ Failure ]
index 8216815c9fa2ab1266f5ba3e2ac3a31adf4b2897..c1134e71fba340aaf66a050c9ea7c540dcc6e459 100644 (file)
@@ -220,6 +220,7 @@ webkit.org/b/98940 fast/events/drag-dataTransferItemList-file-handling.html [ Sk
 
 # setAutomaticLinkDetectionEnabled is not yet implemented.
 webkit.org/b/99069 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]
+webkit.org/b/85463 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Failure ]
 
 # Custom MIME type support in DataTransfer is not yet implemented.
 webkit.org/b/99068 editing/pasteboard/clipboard-customData.html [ Failure ]
index d02b761ab4612d5678244445e7685d90f80c3a80..ecd346582059467d539abeee1888d58ce3ef007a 100644 (file)
@@ -114,6 +114,7 @@ platform/mac/editing/pasteboard/drag-selections-to-contenteditable.html
 platform/mac/fast/forms/listbox-scrollbar-hit-test.html
 
 # [WK2] [Mac] Spellcheck tests don't seem to work
+webkit.org/b/105616 editing/inserting/inserting-slash-inside-url-with-smart-link.html
 webkit.org/b/105616 editing/spelling/spelling-changed-text.html
 webkit.org/b/105616 platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation.html [ Failure ]
 webkit.org/b/105616 platform/mac/editing/spelling/click-autocorrected-word.html
index 2d15c7ab3e31bbabb106b1dad20d653ba8552971..39739ed8881f5e8f46ab57b0ef6da10aefa44ec2 100644 (file)
@@ -342,6 +342,7 @@ webkit.org/b/82886 inspector/styles/override-screen-size.html [ Skip ]
 
 # LayoutTestController::setAutomaticLinkDetectionEnabled isn't implemented
 webkit.org/b/85463 editing/inserting/typing-space-to-trigger-smart-link.html
+webkit.org/b/85463 editing/inserting/smart-link-when-caret-is-moved-before-URL.html
 
 # gestureTwoFingerTap not implemented by this platform (introduced in r132406)
 touchadjustment/touch-links-two-finger-tap.html
index 42c4d084647317ca70ee4970788f1bd22632fb4f..28ff507d4dcd0de9c62a1bc8102162cb66025ff1 100644 (file)
@@ -688,6 +688,7 @@ http/tests/xmlhttprequest/upload-onprogress-event.html
 
 # LayoutTestController::setAutomaticLinkDetectionEnabled isn't implemented
 editing/inserting/typing-space-to-trigger-smart-link.html
+editing/inserting/smart-link-when-caret-is-moved-before-URL.html
 
 ################################################################################
 ######################### Start list of r41995 failures ########################