Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html b/third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html
index bfce76bfdb281516fbaaf9661c1903d5d91431bb..89ada3fa7907925b2de141645c00aa5b8530f9b6 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/context_click_on_selected_misspelling.html
@@ -40,10 +40,24 @@ function assertContextMenuSuggestion(sample, expected) {
}, title);
sample.remove();
- if (++testHolder.finishedCount == 7)
+ if (++testHolder.finishedCount == 9)
testHolder.done();
}
+function doubleClickAt(node, offset) {
+ const document = node.ownerDocument;
+ const range = document.createRange();
+ range.setStart(node, offset);
+ const rect = range.getClientRects()[0];
+ const x = document.offsetLeft + rect.left;
+ const y = document.offsetTop + rect.top + rect.height / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
spellcheck_test(
'<div contenteditable>^wellcome| home.</div>',
'',
@@ -106,4 +120,32 @@ spellcheck_test(
title: 'Has marker on initial misspelling in "wellcome home." with "wellcome home" selected.',
callback: sample => assertContextMenuSuggestion(sample)
});
+
+// Note: for the following test cases related to double clicking, the selection
+// dependends on platform (Win selects a trailing space while other platforms do
+// not), which, however, do not affect the context menu spelling suggestions.
+
+spellcheck_test(
+ '<div contenteditable>wellcome home.</div>',
+ document => {
+ var div = document.querySelector('div');
+ doubleClickAt(div.firstChild, 4);
+ },
+ '<div contenteditable>#wellcome# home.</div>',
+ {
+ title: 'Has marker on misspelled word "wellcome" after selecting it with double-clicking',
+ callback: sample => assertContextMenuSuggestion(sample, 'welcome')
+ });
+
+spellcheck_test(
+ '<div contenteditable>wellcome_ home.</div>',
+ document => {
+ var div = document.querySelector('div');
+ doubleClickAt(div.firstChild, 4);
+ },
+ '<div contenteditable>#wellcome#_ home.</div>',
+ {
+ title: 'Has marker on misspelled word "wellcome" after selecting it and its trailing underscore with double-clicking',
+ callback: sample => assertContextMenuSuggestion(sample, 'welcome')
+ });
</script>

Powered by Google App Engine
This is Rietveld 408576698