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

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

Issue 1679173003: Fix a crash by AdvanceToNextMisspelling command (⌘-;) with empty INPUT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't change html.css Created 4 years, 10 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
new file mode 100644
index 0000000000000000000000000000000000000000..83cfbc76fdf6c23d9b30bcabe78c7d324db5576a
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/editing/spellcheck/SpellChecker.h"
+
+#include "core/editing/EditingTestBase.h"
+#include "core/editing/Editor.h"
+#include "core/frame/Settings.h"
+
+namespace blink {
+
+class SpellCheckerTest : public EditingTestBase {
+};
+
+TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash)
+{
+ setBodyContent("<input placeholder='placeholder'>abc");
+ updateLayoutAndStyleForPainting();
+ RefPtrWillBeRawPtr<Element> input = document().querySelector("input", ASSERT_NO_EXCEPTION);
+ input->focus();
+ document().settings()->setUnifiedTextCheckerEnabled(true);
+ // Do not crash in AdvanceToNextMisspelling command.
+ EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspelling"));
+ document().settings()->setUnifiedTextCheckerEnabled(false);
+}
+
+} // namespace blink
« 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