chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
// Words with spaces are illegal and should be removed.
Words with spaces are illegal and should be removed.
Words with spaces are illegal and should be removed .
TEST_F(SpellcheckCustomDictionaryTest,
       IllegalWordsShouldBeRemovedFromDictionary) {
  FilePath dictionary_path(
      profile_->GetPath().Append(chrome::kCustomDictionaryFileName));
  SpellcheckService* spellcheck_service =
      SpellcheckServiceFactory::GetForProfile(profile_.get());
  SpellcheckCustomDictionary* custom_dictionary =
      spellcheck_service->GetCustomDictionary();
  WordList loaded_custom_words;
  WordList expected;
  std::string content = "foo\nfoo bar\nbar\nfoo bar";
  file_util::WriteFile(dictionary_path, content.c_str(), content.length());
  custom_dictionary->LoadDictionaryIntoCustomWordList(&loaded_custom_words);
  expected.push_back("bar");
  expected.push_back("foo");
  EXPECT_EQ(expected, loaded_custom_words);
  MessageLoop::current()->RunUntilIdle();
}
TEST_F ( SpellcheckCustomDictionaryTest , IllegalWordsShouldBeRemovedFromDictionary ) { FilePath dictionary_path ( profile_ -> GetPath ( ) . Append ( chrome :: kCustomDictionaryFileName ) ) ; SpellcheckService * spellcheck_service = SpellcheckServiceFactory :: GetForProfile ( profile_ . get ( ) ) ; SpellcheckCustomDictionary * custom_dictionary = spellcheck_service -> GetCustomDictionary ( ) ; WordList loaded_custom_words ; WordList expected ; std :: string content = " \n \n \n " ; file_util :: WriteFile ( dictionary_path , content . c_str ( ) , content . length ( ) ) ; custom_dictionary -> LoadDictionaryIntoCustomWordList ( & loaded_custom_words ) ; expected . push_back ( " " ) ; expected . push_back ( " " ) ; EXPECT_EQ ( expected , loaded_custom_words ) ; MessageLoop :: current ( ) -> RunUntilIdle ( ) ; }
Words with spaces are illegal and should be removed.
Words with spaces are illegal and should be removed .
// Flush the loop now to prevent service init tasks from being run during // TearDown();