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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp

Issue 2749153003: Add null position check in SpellChecker::findFirstMisspelling (Closed)
Patch Set: Add bug number Created 3 years, 9 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 | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
index f04995976e7af895203b121b5eb8d4b20c9c036e..1d2d4c5315bf42c3d9e0d02275ce1bb7acdc65b7 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
@@ -40,6 +40,23 @@ TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash) {
document().frame()->editor().executeCommand("AdvanceToNextMisspelling"));
}
+// Regression test for crbug.com/701309
+TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithImageInTableNoCrash) {
+ setBodyContent(
+ "<div contenteditable>"
+ "<table><tr><td>"
+ "<img src=foo.jpg>"
+ "</td></tr></table>"
+ "zz zz zz"
+ "</div>");
+ document().querySelector("div")->focus();
+ updateAllLifecyclePhases();
+
+ // Do not crash in AdvanceToNextMisspelling command.
+ EXPECT_TRUE(
+ document().frame()->editor().executeCommand("AdvanceToNextMisspelling"));
yosin_UTC9 2017/03/15 03:50:48 It is better to call |SpellChecker::advanceToNextM
Xiaocheng 2017/03/15 18:12:26 Done.
+}
+
TEST_F(SpellCheckerTest, SpellCheckDoesNotCauseUpdateLayout) {
setBodyContent("<input>");
HTMLInputElement* input =
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698