diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 01:20:56 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 01:20:56 +0000 |
commit | 8fc0c4db979ee2f2d2423378dd3b9d102d9045c0 (patch) | |
tree | 6daea228a2995bcc527507a994d7615af9bbeb55 /chrome | |
parent | c3515284acdfe396393537c1638443477714c608 (diff) | |
download | chromium_src-8fc0c4db979ee2f2d2423378dd3b9d102d9045c0.zip chromium_src-8fc0c4db979ee2f2d2423378dd3b9d102d9045c0.tar.gz chromium_src-8fc0c4db979ee2f2d2423378dd3b9d102d9045c0.tar.bz2 |
Changes spellcheck_unittest to read dictionaries directly from the src tree. Removes the build rules to copy test dictionaries to Dictionaries/.
Review URL: http://codereview.chromium.org/40082
Patch from rohitrao.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/SConscript | 1 | ||||
-rw-r--r-- | chrome/browser/spellcheck_unittest.cc | 32 | ||||
-rw-r--r-- | chrome/third_party/hunspell/SConscript | 16 | ||||
-rw-r--r-- | chrome/third_party/hunspell/copy_dictionary_files.rules | 19 | ||||
-rw-r--r-- | chrome/third_party/hunspell/hunspell.gyp | 8 | ||||
-rw-r--r-- | chrome/third_party/hunspell/hunspell.vcproj | 19 |
6 files changed, 20 insertions, 75 deletions
diff --git a/chrome/SConscript b/chrome/SConscript index d6a3e78..95b7e1f 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -492,7 +492,6 @@ if env.Bit('windows'): '$DESTINATION_ROOT/First Run', '$DESTINATION_ROOT/themes', Alias('chrome_locales'), - Alias('chrome_Dictionaries'), ]) env.Install('$DESTINATION_ROOT', '$CHROME_DIR/app/FirstRun') diff --git a/chrome/browser/spellcheck_unittest.cc b/chrome/browser/spellcheck_unittest.cc index 0378ad4..cf3fe1b 100644 --- a/chrome/browser/spellcheck_unittest.cc +++ b/chrome/browser/spellcheck_unittest.cc @@ -26,6 +26,18 @@ class SpellCheckTest : public testing::Test { 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 @@ TEST_F(SpellCheckTest, SpellCheckStrings_EN_US) { {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 @@ TEST_F(SpellCheckTest, SpellCheckSuggestions_EN_US) { // 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 @@ TEST_F(SpellCheckTest, DISABLED_SpellCheckAddToDictionary_EN_US) { {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 @@ TEST_F(SpellCheckTest, DISABLED_SpellCheckSuggestionsAddToDictionary_EN_US) { {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)); diff --git a/chrome/third_party/hunspell/SConscript b/chrome/third_party/hunspell/SConscript index c2155fe..c9c92c0 100644 --- a/chrome/third_party/hunspell/SConscript +++ b/chrome/third_party/hunspell/SConscript @@ -100,9 +100,6 @@ input_files = ChromeFileList([ 'src/hunspell/suggestmgr.hxx', 'src/hunspell/utf_info.hxx', ]), - MSVSFilter('Dictionaries', [ - 'dictionaries/en-US-1-2.bdic', - ]), MSVSFilter('google', [ 'google/bdict.h', 'google/bdict_affentry.h', @@ -128,16 +125,6 @@ else: env.ChromeLibrary('hunspell', input_files) -dictionaries = [ - 'dictionaries/en-US-1-2.bdic', - 'dictionaries/en-US.dic', - 'dictionaries/en-US.aff', -] - -i = env.Install('$DESTINATION_ROOT/Dictionaries', dictionaries) -env.Alias('chrome_Dictionaries', i) - - p = env.ChromeMSVSProject('hunspell.vcproj', dest=('$CHROME_SRC_DIR/chrome/' + 'third_party/hunspell/hunspell.vcproj'), @@ -151,7 +138,6 @@ p = env.ChromeMSVSProject('hunspell.vcproj', tools=[ 'VCPreBuildEventTool', 'VCCustomBuildTool', - 'CopyDictionaries', 'VCXMLDataGeneratorTool', 'VCWebServiceProxyGeneratorTool', 'VCMIDLTool', @@ -168,8 +154,6 @@ p = env.ChromeMSVSProject('hunspell.vcproj', ], ConfigurationType='4') -p.AddToolFile('./copy_dictionary_files.rules') - p.AddConfig('Debug|Win32', InheritedPropertySheets=[ '$(SolutionDir)../build/common.vsprops', diff --git a/chrome/third_party/hunspell/copy_dictionary_files.rules b/chrome/third_party/hunspell/copy_dictionary_files.rules index 40a35f4..e69de29 100644 --- a/chrome/third_party/hunspell/copy_dictionary_files.rules +++ b/chrome/third_party/hunspell/copy_dictionary_files.rules @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="Copy dictionary files" - Version="8.00" - > - <Rules> - <CustomBuildRule - Name="CopyDictionaries" - DisplayName="Copy Dictionaries" - CommandLine="xcopy /R /C /Y $(InputPath) $(OutDir)\Dictionaries" - Outputs="$(OutDir)\Dictionaries\$(InputFileName)" - FileExtensions="*.bdic" - ExecutionDescription="Copy dictionary file(s) to output dir" - > - <Properties> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> diff --git a/chrome/third_party/hunspell/hunspell.gyp b/chrome/third_party/hunspell/hunspell.gyp index f2049fd..8b74939 100644 --- a/chrome/third_party/hunspell/hunspell.gyp +++ b/chrome/third_party/hunspell/hunspell.gyp @@ -47,14 +47,6 @@ 'src/parsers/textparser.cxx', 'src/parsers/textparser.hxx', ], - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/Dictionaries', - 'files': [ - 'dictionaries/en-US-1-2.bdic', - ], - }, - ], 'direct_dependent_settings': { 'defines': [ 'HUNSPELL_CHROME_CLIENT', diff --git a/chrome/third_party/hunspell/hunspell.vcproj b/chrome/third_party/hunspell/hunspell.vcproj index d7702a3..eafe363 100644 --- a/chrome/third_party/hunspell/hunspell.vcproj +++ b/chrome/third_party/hunspell/hunspell.vcproj @@ -12,11 +12,6 @@ Name="Win32" /> </Platforms> - <ToolFiles> - <ToolFile - RelativePath=".\copy_dictionary_files.rules" - /> - </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" @@ -30,9 +25,6 @@ Name="VCCustomBuildTool" /> <Tool - Name="CopyDictionaries" - /> - <Tool Name="VCXMLDataGeneratorTool" /> <Tool @@ -84,9 +76,6 @@ Name="VCCustomBuildTool" /> <Tool - Name="CopyDictionaries" - /> - <Tool Name="VCXMLDataGeneratorTool" /> <Tool @@ -227,14 +216,6 @@ </File> </Filter> <Filter - Name="Dictionaries" - > - <File - RelativePath=".\dictionaries\en-US-1-2.bdic" - > - </File> - </Filter> - <Filter Name="google" > <File |