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

Unified Diff: components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc

Issue 2712833004: Stop SpellCheckProvider from deciding typing progress (Closed)
Patch Set: Add comment about partial word Created 3 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 | « components/spellcheck/renderer/spellcheck_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc
diff --git a/components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc b/components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc
index 3ada8e9a240b90ebd1cf597059b274c1ae42efa1..29003699058df758c61b0e8e2c9e6cf8bd7aece9 100644
--- a/components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc
+++ b/components/spellcheck/renderer/spellcheck_provider_hunspell_unittest.cc
@@ -39,19 +39,12 @@ TEST_F(SpellCheckProviderTest, MultiLineText) {
std::vector<SpellCheckMarker>());
EXPECT_TRUE(provider_.text_.empty());
- // Verify that the SpellCheckProvider class does not spellcheck text while we
- // are typing a word.
- provider_.ResetResult();
- provider_.RequestTextChecking(ASCIIToUTF16("First"), &completion,
- std::vector<SpellCheckMarker>());
- EXPECT_TRUE(provider_.text_.empty());
-
// Verify that the SpellCheckProvider class spellcheck the first word when we
- // type a space key, i.e. when we finish typing a word.
+ // stop typing after finishing the first word.
provider_.ResetResult();
- provider_.RequestTextChecking(ASCIIToUTF16("First "), &completion,
+ provider_.RequestTextChecking(ASCIIToUTF16("First"), &completion,
std::vector<SpellCheckMarker>());
- EXPECT_EQ(ASCIIToUTF16("First "), provider_.text_);
+ EXPECT_EQ(ASCIIToUTF16("First"), provider_.text_);
// Verify that the SpellCheckProvider class spellcheck the first line when we
// type a return key, i.e. when we finish typing a line.
@@ -142,27 +135,4 @@ TEST_F(SpellCheckProviderTest, CompleteNecessaryRequests) {
<< text << "\"";
}
-// Tests that the SpellCheckProvider cancels spelling requests in the middle of
-// a word.
-TEST_F(SpellCheckProviderTest, CancelMidWordRequests) {
- FakeTextCheckingCompletion completion;
- provider_.RequestTextChecking(ASCIIToUTF16("hello "), &completion,
- std::vector<SpellCheckMarker>());
- EXPECT_EQ(completion.completion_count_, 1U);
- EXPECT_EQ(completion.cancellation_count_, 0U);
- EXPECT_EQ(provider_.spelling_service_call_count_, 1U);
-
- provider_.RequestTextChecking(ASCIIToUTF16("hello world"), &completion,
- std::vector<SpellCheckMarker>());
- EXPECT_EQ(completion.completion_count_, 2U);
- EXPECT_EQ(completion.cancellation_count_, 1U);
- EXPECT_EQ(provider_.spelling_service_call_count_, 1U);
-
- provider_.RequestTextChecking(ASCIIToUTF16("hello world."), &completion,
- std::vector<SpellCheckMarker>());
- EXPECT_EQ(completion.completion_count_, 3U);
- EXPECT_EQ(completion.cancellation_count_, 1U);
- EXPECT_EQ(provider_.spelling_service_call_count_, 2U);
-}
-
} // namespace
« no previous file with comments | « components/spellcheck/renderer/spellcheck_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698