chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
// Legacy dictionary with two words should be converted to new format dictionary
// with two words.
Legacy dictionary with two words should be converted to new format dictionary
with two words.
Legacy dictionary with two words should be converted to new format dictionary with two words .
TEST_F(SpellcheckCustomDictionaryTest,
       LegacyDictionaryWithTwoWordsShouldBeConverted) {
  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\nbar";
  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 , LegacyDictionaryWithTwoWordsShouldBeConverted ) { 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 " ; 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 ( ) ; }
Legacy dictionary with two words should be converted to new format dictionary
with two words.
Legacy dictionary with two words should be converted to new format dictionary with two words .
// Flush the loop now to prevent service init tasks from being run during // TearDown();