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

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

Issue 2919913002: Add SpellCheckTestBase::GetSpellChecker() (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/SpellCheckTestBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/IdleSpellCheckCallback.h" 5 #include "core/editing/spellcheck/IdleSpellCheckCallback.h"
6 6
7 #include "core/editing/spellcheck/SpellCheckTestBase.h" 7 #include "core/editing/spellcheck/SpellCheckTestBase.h"
8 #include "core/editing/spellcheck/SpellChecker.h" 8 #include "core/editing/spellcheck/SpellChecker.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 using State = IdleSpellCheckCallback::State; 14 using State = IdleSpellCheckCallback::State;
15 15
16 class IdleSpellCheckCallbackTest : public SpellCheckTestBase { 16 class IdleSpellCheckCallbackTest : public SpellCheckTestBase {
17 protected: 17 protected:
18 IdleSpellCheckCallback& IdleChecker() { 18 IdleSpellCheckCallback& IdleChecker() {
19 return GetFrame().GetSpellChecker().GetIdleSpellCheckCallback(); 19 return GetSpellChecker().GetIdleSpellCheckCallback();
20 } 20 }
21 21
22 void TransitTo(State state) { 22 void TransitTo(State state) {
23 switch (state) { 23 switch (state) {
24 case State::kInactive: 24 case State::kInactive:
25 IdleChecker().Deactivate(); 25 IdleChecker().Deactivate();
26 break; 26 break;
27 case State::kHotModeRequested: 27 case State::kHotModeRequested:
28 IdleChecker().SetNeedsInvocation(); 28 IdleChecker().SetNeedsInvocation();
29 break; 29 break;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return; 200 return;
201 if (!RuntimeEnabledFeatures::idleTimeColdModeSpellCheckingEnabled()) 201 if (!RuntimeEnabledFeatures::idleTimeColdModeSpellCheckingEnabled())
202 return; 202 return;
203 203
204 TransitTo(State::kColdModeRequested); 204 TransitTo(State::kColdModeRequested);
205 GetDocument().Shutdown(); 205 GetDocument().Shutdown();
206 EXPECT_EQ(State::kInactive, IdleChecker().GetState()); 206 EXPECT_EQ(State::kInactive, IdleChecker().GetState());
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/SpellCheckTestBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698