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

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

Issue 2749153003: Add null position check in SpellChecker::findFirstMisspelling (Closed)
Patch Set: Wed Mar 15 11:10:41 PDT 2017 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..1b6fbca103e33089c6677e7eeecb86c8c956ebde 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
@@ -40,6 +40,22 @@ 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.
+ document().frame()->spellChecker().advanceToNextMisspelling(false);
+}
+
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