| Index: chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
|
| diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
|
| index b5fb4253be5d799a4e88c3ee9b1aaa235607f581..bdbc15ea52f963249653d8dab66c3ae504b859f2 100644
|
| --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
|
| +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
|
| @@ -45,7 +45,6 @@ class SpellcheckCustomDictionaryTest : public testing::Test {
|
| scoped_ptr<TestingProfile> profile_;
|
| };
|
|
|
| -// TODO(rlp/rouslan): Shift some of these to a cutsom dictionary test suite.
|
| TEST_F(SpellcheckCustomDictionaryTest, SpellcheckSetCustomWordList) {
|
| SpellcheckService* spellcheck_service =
|
| SpellcheckServiceFactory::GetForProfile(profile_.get());
|
| @@ -60,14 +59,13 @@ TEST_F(SpellcheckCustomDictionaryTest, SpellcheckSetCustomWordList) {
|
| EXPECT_EQ(custom_dictionary->GetWords(), expected);
|
| }
|
|
|
| -TEST_F(SpellcheckCustomDictionaryTest, CustomWordAddedLocally) {
|
| +TEST_F(SpellcheckCustomDictionaryTest, CustomWordAddedAndRemovedLocally) {
|
| SpellcheckService* spellcheck_service =
|
| SpellcheckServiceFactory::GetForProfile(profile_.get());
|
|
|
| WordList loaded_custom_words;
|
| SpellcheckCustomDictionary* custom_dictionary =
|
| spellcheck_service->GetCustomDictionary();
|
| - custom_dictionary->Load();
|
| WordList expected;
|
| EXPECT_EQ(custom_dictionary->GetWords(), expected);
|
| custom_dictionary->CustomWordAddedLocally("foo");
|
| @@ -76,6 +74,11 @@ TEST_F(SpellcheckCustomDictionaryTest, CustomWordAddedLocally) {
|
| custom_dictionary->CustomWordAddedLocally("bar");
|
| expected.push_back("bar");
|
| EXPECT_EQ(custom_dictionary->GetWords(), expected);
|
| +
|
| + custom_dictionary->CustomWordRemovedLocally("foo");
|
| + custom_dictionary->CustomWordRemovedLocally("bar");
|
| + expected.clear();
|
| + EXPECT_EQ(custom_dictionary->GetWords(), expected);
|
| }
|
|
|
| TEST_F(SpellcheckCustomDictionaryTest, SaveAndLoad) {
|
| @@ -108,6 +111,13 @@ TEST_F(SpellcheckCustomDictionaryTest, SaveAndLoad) {
|
| spellcheck_service2.GetCustomDictionary()->
|
| LoadDictionaryIntoCustomWordList(&loaded_custom_words2);
|
| EXPECT_EQ(loaded_custom_words2, expected);
|
| +
|
| + custom_dictionary->EraseWordFromCustomDictionary("foo");
|
| + custom_dictionary->EraseWordFromCustomDictionary("bar");
|
| + custom_dictionary->LoadDictionaryIntoCustomWordList(&loaded_custom_words);
|
| + expected.clear();
|
| + EXPECT_EQ(loaded_custom_words, expected);
|
| +
|
| // Flush the loop now to prevent service init tasks from being run during
|
| // TearDown();
|
| MessageLoop::current()->RunUntilIdle();
|
|
|