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

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

Issue 2459553002: Convert editing/spelling/spelling-*-selection.html with spellcheck_test (Closed)
Patch Set: Also convert spelling-{subword,multiword}-selection.html Created 4 years, 2 months 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-multiword-selection.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1d7a98e689f79d8eec0a181d59bf45f71b4aa872..bfce76bfdb281516fbaaf9661c1903d5d91431bb 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
@@ -32,13 +32,15 @@ function contextClickOnSelection(selection) {
}
function assertContextMenuSuggestion(sample, expected) {
+ var title = `Context clicking on selected "${sample.selection.toString()}" ` +
+ (expected ? `gives suggestion "${expected}".` : 'does not give any suggestion.');
test(() => {
const suggestions = contextClickOnSelection(sample.selection);
- assert_equals(suggestions[suggestions.length - 1], expected);
- }, `Context clicking on exactly-selected "${sample.selection.toString()}" gives suggestions "${expected}".`);
+ assert_equals(suggestions[suggestions.length - 1], expected || '<separator>');
+ }, title);
sample.remove();
- if (++testHolder.finishedCount == 2)
+ if (++testHolder.finishedCount == 7)
testHolder.done();
}
@@ -47,7 +49,7 @@ spellcheck_test(
'',
'<div contenteditable>#wellcome# home.</div>',
{
- title: 'Has marker on initial misspelling.',
+ title: 'Has marker on initial misspelling in "wellcome home.".',
callback: sample => assertContextMenuSuggestion(sample, 'welcome')
});
@@ -56,7 +58,52 @@ spellcheck_test(
'',
'<div contenteditable>It should be #upper case#.</div>',
{
- title: 'Has marker on initial multi-word misspelling.',
+ title: 'Has marker on initial multi-word misspelling in "It should be upper case.".',
callback: sample => assertContextMenuSuggestion(sample, 'uppercase')
});
+
+spellcheck_test(
+ '<div contenteditable>hello,^ wellcome |home.</div>',
+ '',
+ '<div contenteditable>hello, #wellcome# home.</div>',
+ {
+ title: 'Has marker on initial misspelling in "hello, wellcome home.".',
+ callback: sample => assertContextMenuSuggestion(sample, 'welcome')
+ });
+
+spellcheck_test(
+ '<div contenteditable>Hi, ^_wellcome_| home.</div>',
+ '',
+ '<div contenteditable>Hi, _#wellcome#_ home.</div>',
+ {
+ title: 'Has marker on initial misspelling in "Hi, wellcome home.".',
+ callback: sample => assertContextMenuSuggestion(sample, 'welcome')
+ });
+
+spellcheck_test(
+ '<div contenteditable>^wellcome!|</div>',
+ '',
+ '<div contenteditable>#wellcome#!</div>',
+ {
+ title: 'Has marker on initial misspelling in "wellcome!".',
+ callback: sample => assertContextMenuSuggestion(sample, 'welcome')
+ });
+
+spellcheck_test(
+ '<div contenteditable>we^llco|me home.</div>',
+ '',
+ '<div contenteditable>#wellcome# home.</div>',
+ {
+ title: 'Has marker on initial misspelling in "wellcome home." with "llco" selected.',
+ callback: sample => assertContextMenuSuggestion(sample)
+ });
+
+spellcheck_test(
+ '<div contenteditable>^wellcome home|.</div>',
+ '',
+ '<div contenteditable>#wellcome# home.</div>',
+ {
+ title: 'Has marker on initial misspelling in "wellcome home." with "wellcome home" selected.',
+ callback: sample => assertContextMenuSuggestion(sample)
+ });
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-multiword-selection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698