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

Unified Diff: chrome/browser/spellcheck_unittest.cc

Issue 40082: Changes spellcheck_unittest to read dictionaries directly from the src tree (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | « chrome/SConscript ('k') | chrome/third_party/hunspell/SConscript » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellcheck_unittest.cc
===================================================================
--- chrome/browser/spellcheck_unittest.cc (revision 10888)
+++ chrome/browser/spellcheck_unittest.cc (working copy)
@@ -26,6 +26,18 @@
extern void InitHunspellWithFiles(FILE* file_aff_hunspell,
FILE* file_dic_hunspell);
+FilePath GetHunspellDirectory() {
+ FilePath hunspell_directory;
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, &hunspell_directory))
+ return FilePath();
+
+ hunspell_directory = hunspell_directory.AppendASCII("chrome");
+ hunspell_directory = hunspell_directory.AppendASCII("third_party");
+ hunspell_directory = hunspell_directory.AppendASCII("hunspell");
+ hunspell_directory = hunspell_directory.AppendASCII("dictionaries");
+ return hunspell_directory;
+}
+
// Operates unit tests for the webkit_glue::SpellCheckWord() function
// with the US English dictionary.
// The unit tests in this function consist of:
@@ -249,9 +261,8 @@
{L"ifmmp:ifmmp", false, 0, 11},
};
- FilePath hunspell_directory;
- ASSERT_TRUE(PathService::Get(chrome::DIR_APP_DICTIONARIES,
- &hunspell_directory));
+ FilePath hunspell_directory = GetHunspellDirectory();
+ ASSERT_FALSE(hunspell_directory.empty());
scoped_refptr<SpellChecker> spell_checker(new SpellChecker(
hunspell_directory, L"en-US", NULL, FilePath()));
@@ -303,9 +314,8 @@
// TODO (Sidchat): add many more examples.
};
- FilePath hunspell_directory;
- ASSERT_TRUE(PathService::Get(chrome::DIR_APP_DICTIONARIES,
- &hunspell_directory));
+ FilePath hunspell_directory = GetHunspellDirectory();
+ ASSERT_FALSE(hunspell_directory.empty());
scoped_refptr<SpellChecker> spell_checker(new SpellChecker(
hunspell_directory, L"en-US", NULL, FilePath()));
@@ -351,10 +361,9 @@
{L"Googler"},
};
- FilePath hunspell_directory;
FilePath custom_dictionary_file(kTempCustomDictionaryFile);
- ASSERT_TRUE(PathService::Get(chrome::DIR_APP_DICTIONARIES,
- &hunspell_directory));
+ FilePath hunspell_directory = GetHunspellDirectory();
+ ASSERT_FALSE(hunspell_directory.empty());
scoped_refptr<SpellChecker> spell_checker(new SpellChecker(
hunspell_directory, L"en-US", NULL, custom_dictionary_file));
@@ -420,10 +429,9 @@
{L"Googler"},
};
- FilePath hunspell_directory;
FilePath custom_dictionary_file(kTempCustomDictionaryFile);
- ASSERT_TRUE(PathService::Get(chrome::DIR_APP_DICTIONARIES,
- &hunspell_directory));
+ FilePath hunspell_directory = GetHunspellDirectory();
+ ASSERT_FALSE(hunspell_directory.empty());
scoped_refptr<SpellChecker> spell_checker(new SpellChecker(
hunspell_directory, L"en-US", NULL, custom_dictionary_file));
« no previous file with comments | « chrome/SConscript ('k') | chrome/third_party/hunspell/SConscript » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698