OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "chrome/browser/spellchecker/spellcheck_host.h" | 8 #include "chrome/browser/spellchecker/spellcheck_host.h" |
9 #include "chrome/browser/spellchecker/spellcheck_profile.h" | 9 #include "chrome/browser/spellchecker/spellcheck_profile.h" |
10 #include "content/test/test_browser_thread.h" | 10 #include "content/test/test_browser_thread.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using content::BrowserThread; | 14 using content::BrowserThread; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class MockSpellCheckHost : public SpellCheckHost { | 18 class MockSpellCheckHost : public SpellCheckHost { |
19 public: | 19 public: |
20 MOCK_METHOD0(UnsetProfile, void()); | 20 MOCK_METHOD0(UnsetProfile, void()); |
21 MOCK_METHOD1(InitForRenderer, void(RenderProcessHost* process)); | 21 MOCK_METHOD1(InitForRenderer, void(content::RenderProcessHost* process)); |
22 MOCK_METHOD1(AddWord, void(const std::string& word)); | 22 MOCK_METHOD1(AddWord, void(const std::string& word)); |
23 MOCK_CONST_METHOD0(GetDictionaryFile, const base::PlatformFile&()); | 23 MOCK_CONST_METHOD0(GetDictionaryFile, const base::PlatformFile&()); |
24 MOCK_CONST_METHOD0(GetCustomWords, | 24 MOCK_CONST_METHOD0(GetCustomWords, |
25 const SpellCheckProfile::CustomWordList&()); | 25 const SpellCheckProfile::CustomWordList&()); |
26 MOCK_CONST_METHOD0(GetLastAddedFile, const std::string&()); | 26 MOCK_CONST_METHOD0(GetLastAddedFile, const std::string&()); |
27 MOCK_CONST_METHOD0(GetLanguage, const std::string&()); | 27 MOCK_CONST_METHOD0(GetLanguage, const std::string&()); |
28 MOCK_CONST_METHOD0(IsUsingPlatformChecker, bool()); | 28 MOCK_CONST_METHOD0(IsUsingPlatformChecker, bool()); |
29 MOCK_CONST_METHOD0(GetMetrics, SpellCheckHostMetrics*()); | 29 MOCK_CONST_METHOD0(GetMetrics, SpellCheckHostMetrics*()); |
30 MOCK_CONST_METHOD0(IsReady, bool()); | 30 MOCK_CONST_METHOD0(IsReady, bool()); |
31 }; | 31 }; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 expected2.push_back("fuga"); | 274 expected2.push_back("fuga"); |
275 | 275 |
276 SpellCheckProfile::CustomWordList actual1; | 276 SpellCheckProfile::CustomWordList actual1; |
277 target1.LoadCustomDictionary(&actual1); | 277 target1.LoadCustomDictionary(&actual1); |
278 EXPECT_EQ(actual1, expected1); | 278 EXPECT_EQ(actual1, expected1); |
279 | 279 |
280 SpellCheckProfile::CustomWordList actual2; | 280 SpellCheckProfile::CustomWordList actual2; |
281 target2.LoadCustomDictionary(&actual2); | 281 target2.LoadCustomDictionary(&actual2); |
282 EXPECT_EQ(actual2, expected2); | 282 EXPECT_EQ(actual2, expected2); |
283 } | 283 } |
OLD | NEW |