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/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" | 8 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" |
9 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 9 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
10 #include "chrome/browser/spellchecker/spellcheck_service.h" | 10 #include "chrome/browser/spellchecker/spellcheck_service.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 class SpellcheckServiceTest : public testing::Test { | 24 class SpellcheckServiceTest : public testing::Test { |
25 protected: | 25 protected: |
26 SpellcheckServiceTest() | 26 SpellcheckServiceTest() |
27 : ui_thread_(BrowserThread::UI, &message_loop_), | 27 : ui_thread_(BrowserThread::UI, &message_loop_), |
28 file_thread_(BrowserThread::FILE, &message_loop_), | 28 file_thread_(BrowserThread::FILE, &message_loop_), |
29 profile_(new TestingProfile()) { | 29 profile_(new TestingProfile()) { |
30 } | 30 } |
31 | 31 |
32 void SetUp() OVERRIDE { | 32 virtual void SetUp() OVERRIDE { |
33 // Use SetTestingFactoryAndUse to force creation and initialization. | 33 // Use SetTestingFactoryAndUse to force creation and initialization. |
34 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 34 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
35 profile_.get(), &BuildSpellcheckService); | 35 profile_.get(), &BuildSpellcheckService); |
36 } | 36 } |
37 | 37 |
38 void TearDown() OVERRIDE { | 38 virtual void TearDown() OVERRIDE { |
39 MessageLoop::current()->RunUntilIdle(); | 39 MessageLoop::current()->RunUntilIdle(); |
40 } | 40 } |
41 | 41 |
42 MessageLoop message_loop_; | 42 MessageLoop message_loop_; |
43 content::TestBrowserThread ui_thread_; | 43 content::TestBrowserThread ui_thread_; |
44 content::TestBrowserThread file_thread_; | 44 content::TestBrowserThread file_thread_; |
45 | 45 |
46 scoped_ptr<TestingProfile> profile_; | 46 scoped_ptr<TestingProfile> profile_; |
47 }; | 47 }; |
48 | 48 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 accept_languages.push_back("fr"); | 113 accept_languages.push_back("fr"); |
114 accept_languages.push_back("aa"); // Will not exist. | 114 accept_languages.push_back("aa"); // Will not exist. |
115 std::vector<std::string> languages; | 115 std::vector<std::string> languages; |
116 | 116 |
117 SpellcheckService::GetSpellCheckLanguagesFromAcceptLanguages( | 117 SpellcheckService::GetSpellCheckLanguagesFromAcceptLanguages( |
118 accept_languages, "fr", &languages); | 118 accept_languages, "fr", &languages); |
119 | 119 |
120 EXPECT_EQ(1U, languages.size()); | 120 EXPECT_EQ(1U, languages.size()); |
121 EXPECT_EQ("fr", languages[0]); | 121 EXPECT_EQ("fr", languages[0]); |
122 } | 122 } |
OLD | NEW |