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

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

Issue 2235643002: Code cleanup related to unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableUnifiedTextCheckerByDefault
Patch Set: Rebased on removal of grammar-checking code Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/spellcheck/SpellChecker.h" 5 #include "core/editing/spellcheck/SpellChecker.h"
6 6
7 #include "core/editing/EditingTestBase.h" 7 #include "core/editing/EditingTestBase.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class SpellCheckerTest : public EditingTestBase { 14 class SpellCheckerTest : public EditingTestBase {
15 }; 15 };
16 16
17 TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash) 17 TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash)
18 { 18 {
19 setBodyContent("<input placeholder='placeholder'>abc"); 19 setBodyContent("<input placeholder='placeholder'>abc");
20 updateAllLifecyclePhases(); 20 updateAllLifecyclePhases();
21 Element* input = document().querySelector("input"); 21 Element* input = document().querySelector("input");
22 input->focus(); 22 input->focus();
23 document().settings()->setUnifiedTextCheckerEnabled(true);
24 // Do not crash in AdvanceToNextMisspelling command. 23 // Do not crash in AdvanceToNextMisspelling command.
25 EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspe lling")); 24 EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspe lling"));
26 document().settings()->setUnifiedTextCheckerEnabled(false);
27 } 25 }
28 26
29 } // namespace blink 27 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698