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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/editing/spellcheck/SpellChecker.h"
6
7 #include "core/editing/EditingTestBase.h"
8 #include "core/editing/Editor.h"
9 #include "core/frame/Settings.h"
10
11 namespace blink {
12
13 class SpellCheckerTest : public EditingTestBase {
14 };
15
16 TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash)
17 {
18 setBodyContent("<input placeholder='placeholder'>abc");
19 updateLayoutAndStyleForPainting();
20 RefPtrWillBeRawPtr<Element> input = document().querySelector("input", ASSERT _NO_EXCEPTION);
21 input->focus();
22 document().settings()->setUnifiedTextCheckerEnabled(true);
23 // Do not crash in AdvanceToNextMisspelling command.
24 EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspe lling"));
25 document().settings()->setUnifiedTextCheckerEnabled(false);
26 }
27
28 } // namespace blink
OLDNEW
« 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