| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" | 9 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" |
| 10 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 10 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 class SpellcheckCustomDictionaryTest : public testing::Test { | 52 class SpellcheckCustomDictionaryTest : public testing::Test { |
| 53 protected: | 53 protected: |
| 54 SpellcheckCustomDictionaryTest() | 54 SpellcheckCustomDictionaryTest() |
| 55 : ui_thread_(BrowserThread::UI, &message_loop_), | 55 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 56 file_thread_(BrowserThread::FILE, &message_loop_), | 56 file_thread_(BrowserThread::FILE, &message_loop_), |
| 57 profile_(new TestingProfile) { | 57 profile_(new TestingProfile) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 void SetUp() OVERRIDE { | 60 virtual void SetUp() OVERRIDE { |
| 61 // Use SetTestingFactoryAndUse to force creation and initialization. | 61 // Use SetTestingFactoryAndUse to force creation and initialization. |
| 62 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 62 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 63 profile_.get(), &BuildSpellcheckService); | 63 profile_.get(), &BuildSpellcheckService); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void TearDown() OVERRIDE { | 66 virtual void TearDown() OVERRIDE { |
| 67 MessageLoop::current()->RunUntilIdle(); | 67 MessageLoop::current()->RunUntilIdle(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private | 70 // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private |
| 71 // function to avoid a large number of FRIEND_TEST declarations in | 71 // function to avoid a large number of FRIEND_TEST declarations in |
| 72 // SpellcheckCustomDictionary. | 72 // SpellcheckCustomDictionary. |
| 73 chrome::spellcheck_common::WordList LoadDictionaryFile(const FilePath& path) { | 73 chrome::spellcheck_common::WordList LoadDictionaryFile(const FilePath& path) { |
| 74 return SpellcheckCustomDictionary::LoadDictionaryFile(path); | 74 return SpellcheckCustomDictionary::LoadDictionaryFile(path); |
| 75 } | 75 } |
| 76 | 76 |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1156 |
| 1157 // The sync server should not receive more words, because it has the maximum | 1157 // The sync server should not receive more words, because it has the maximum |
| 1158 // number of words already. | 1158 // number of words already. |
| 1159 EXPECT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, | 1159 EXPECT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, |
| 1160 server_custom_dictionary->GetWords().size()); | 1160 server_custom_dictionary->GetWords().size()); |
| 1161 | 1161 |
| 1162 // Flush the loop now to prevent service init tasks from being run during | 1162 // Flush the loop now to prevent service init tasks from being run during |
| 1163 // TearDown(); | 1163 // TearDown(); |
| 1164 MessageLoop::current()->RunUntilIdle(); | 1164 MessageLoop::current()->RunUntilIdle(); |
| 1165 } | 1165 } |
| OLD | NEW |