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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc

Issue 10533077: Implement a request cache and disble retrieving a sub-region. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc
===================================================================
--- chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc (revision 141385)
+++ chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc (working copy)
@@ -58,6 +58,7 @@
text_check_completions_.Remove(identifier);
completion->didFinishCheckingText(
std::vector<WebKit::WebTextCheckingResult>());
+ last_request_ = text;
}
void ResetResult() {
@@ -151,13 +152,13 @@
EXPECT_EQ(0, provider_.offset_);
EXPECT_EQ(ASCIIToUTF16("First Second\n"), provider_.text_);
- // Verify that the SpellCheckProvider class spellcheck the second line when we
+ // Verify that the SpellCheckProvider class spellcheck the lines when we
// finish typing a word "Third" to the second line.
provider_.ResetResult();
provider_.RequestTextChecking(WebKit::WebString("First Second\nThird "), 0,
&completion);
- EXPECT_EQ(13, provider_.offset_);
- EXPECT_EQ(ASCIIToUTF16("Third "), provider_.text_);
+ EXPECT_EQ(0, provider_.offset_);
+ EXPECT_EQ(ASCIIToUTF16("First Second\nThird "), provider_.text_);
// Verify that the SpellCheckProvider class does not send a spellcheck request
// when a user inserts whitespace characters.
@@ -167,13 +168,13 @@
EXPECT_EQ(-1, provider_.offset_);
EXPECT_TRUE(provider_.text_.empty());
- // Verify that the SpellCheckProvider class spellcheck the second line when we
- // type a period.
+ // Verify that the SpellCheckProvider class spellcheck the lines when we type
+ // a period.
provider_.ResetResult();
provider_.RequestTextChecking(
WebKit::WebString("First Second\nThird Fourth."), 0, &completion);
- EXPECT_EQ(13, provider_.offset_);
- EXPECT_EQ(ASCIIToUTF16("Third Fourth."), provider_.text_);
+ EXPECT_EQ(0, provider_.offset_);
+ EXPECT_EQ(ASCIIToUTF16("First Second\nThird Fourth."), provider_.text_);
}
// Tests that the SpellCheckProvider class cancels incoming spellcheck requests
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698