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

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

Issue 2740503002: Remove timeout from idle time spell checker's cold mode request (Closed)
Patch Set: Make change more verbose 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.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
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"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 idleChecker().setNeedsInvocation(); 72 idleChecker().setNeedsInvocation();
73 EXPECT_EQ(State::kHotModeRequested, idleChecker().state()); 73 EXPECT_EQ(State::kHotModeRequested, idleChecker().state());
74 EXPECT_NE(-1, idleChecker().idleCallbackHandle()); 74 EXPECT_NE(-1, idleChecker().idleCallbackHandle());
75 } 75 }
76 76
77 TEST_F(IdleSpellCheckCallbackTest, RequestWhenColdModeRequested) { 77 TEST_F(IdleSpellCheckCallbackTest, RequestWhenColdModeRequested) {
78 transitTo(State::kColdModeRequested); 78 transitTo(State::kColdModeRequested);
79 int handle = idleChecker().idleCallbackHandle(); 79 int handle = idleChecker().idleCallbackHandle();
80 idleChecker().setNeedsInvocation(); 80 idleChecker().setNeedsInvocation();
81 EXPECT_EQ(State::kHotModeRequested, idleChecker().state()); 81 EXPECT_EQ(State::kHotModeRequested, idleChecker().state());
82 EXPECT_EQ(handle, idleChecker().idleCallbackHandle()); 82 EXPECT_NE(handle, idleChecker().idleCallbackHandle());
83 EXPECT_NE(-1, idleChecker().idleCallbackHandle()); 83 EXPECT_NE(-1, idleChecker().idleCallbackHandle());
84 } 84 }
85 85
86 TEST_F(IdleSpellCheckCallbackTest, HotModeTransitToColdMode) { 86 TEST_F(IdleSpellCheckCallbackTest, HotModeTransitToColdMode) {
87 transitTo(State::kHotModeRequested); 87 transitTo(State::kHotModeRequested);
88 idleChecker().forceInvocationForTesting(); 88 idleChecker().forceInvocationForTesting();
89 EXPECT_EQ(State::kColdModeTimerStarted, idleChecker().state()); 89 EXPECT_EQ(State::kColdModeTimerStarted, idleChecker().state());
90 } 90 }
91 91
92 TEST_F(IdleSpellCheckCallbackTest, ColdModeTimerStartedToRequested) { 92 TEST_F(IdleSpellCheckCallbackTest, ColdModeTimerStartedToRequested) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 EXPECT_EQ(State::kInactive, idleChecker().state()); 127 EXPECT_EQ(State::kInactive, idleChecker().state());
128 } 128 }
129 129
130 TEST_F(IdleSpellCheckCallbackTest, DetachWhenColdModeRequested) { 130 TEST_F(IdleSpellCheckCallbackTest, DetachWhenColdModeRequested) {
131 transitTo(State::kColdModeRequested); 131 transitTo(State::kColdModeRequested);
132 document().shutdown(); 132 document().shutdown();
133 EXPECT_EQ(State::kInactive, idleChecker().state()); 133 EXPECT_EQ(State::kInactive, idleChecker().state());
134 } 134 }
135 135
136 } // namespace blink 136 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698