| 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; |
| 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 class MockSpellCheckHost : public SpellCheckHost { | 18 class MockSpellCheckHost : public SpellCheckHost { |
| 17 public: | 19 public: |
| 18 MOCK_METHOD0(UnsetProfile, void()); | 20 MOCK_METHOD0(UnsetProfile, void()); |
| 19 MOCK_METHOD1(InitForRenderer, void(RenderProcessHost* process)); | 21 MOCK_METHOD1(InitForRenderer, void(RenderProcessHost* process)); |
| 20 MOCK_METHOD1(AddWord, void(const std::string& word)); | 22 MOCK_METHOD1(AddWord, void(const std::string& word)); |
| 21 MOCK_CONST_METHOD0(GetDictionaryFile, const base::PlatformFile&()); | 23 MOCK_CONST_METHOD0(GetDictionaryFile, const base::PlatformFile&()); |
| 22 MOCK_CONST_METHOD0(GetCustomWords, | 24 MOCK_CONST_METHOD0(GetCustomWords, |
| 23 const SpellCheckProfile::CustomWordList&()); | 25 const SpellCheckProfile::CustomWordList&()); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 expected2.push_back("fuga"); | 275 expected2.push_back("fuga"); |
| 274 | 276 |
| 275 SpellCheckProfile::CustomWordList actual1; | 277 SpellCheckProfile::CustomWordList actual1; |
| 276 target1.LoadCustomDictionary(&actual1); | 278 target1.LoadCustomDictionary(&actual1); |
| 277 EXPECT_EQ(actual1, expected1); | 279 EXPECT_EQ(actual1, expected1); |
| 278 | 280 |
| 279 SpellCheckProfile::CustomWordList actual2; | 281 SpellCheckProfile::CustomWordList actual2; |
| 280 target2.LoadCustomDictionary(&actual2); | 282 target2.LoadCustomDictionary(&actual2); |
| 281 EXPECT_EQ(actual2, expected2); | 283 EXPECT_EQ(actual2, expected2); |
| 282 } | 284 } |
| OLD | NEW |