Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/spellchecker/spellcheck_profile_unittest.cc

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/scoped_temp_dir.h" 7 #include "base/scoped_temp_dir.h"
8 #include "chrome/browser/spellchecker/spellcheck_factory.h" 8 #include "chrome/browser/spellchecker/spellcheck_factory.h"
9 #include "chrome/browser/spellchecker/spellcheck_host.h" 9 #include "chrome/browser/spellchecker/spellcheck_host.h"
10 #include "chrome/browser/spellchecker/spellcheck_profile.h" 10 #include "chrome/browser/spellchecker/spellcheck_profile.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void SetHostToBeCreated(MockSpellCheckHost* host) { 58 void SetHostToBeCreated(MockSpellCheckHost* host) {
59 EXPECT_CALL(*host, UnsetProfile()).Times(1); 59 EXPECT_CALL(*host, UnsetProfile()).Times(1);
60 EXPECT_CALL(*host, IsReady()).WillRepeatedly(testing::Return(true)); 60 EXPECT_CALL(*host, IsReady()).WillRepeatedly(testing::Return(true));
61 returning_from_create_.reset(host); 61 returning_from_create_.reset(host);
62 } 62 }
63 63
64 size_t create_host_calls_; 64 size_t create_host_calls_;
65 scoped_ptr<SpellCheckHost> returning_from_create_; 65 scoped_ptr<SpellCheckHost> returning_from_create_;
66 }; 66 };
67 67
68 ProfileKeyedBase* BuildTestingSpellCheckProfile(Profile* profile) { 68 ProfileKeyedService* BuildTestingSpellCheckProfile(Profile* profile) {
69 return new TestingSpellCheckProfile(profile); 69 return new TestingSpellCheckProfile(profile);
70 } 70 }
71 71
72 class SpellCheckProfileTest : public testing::Test { 72 class SpellCheckProfileTest : public testing::Test {
73 protected: 73 protected:
74 SpellCheckProfileTest() 74 SpellCheckProfileTest()
75 : file_thread_(BrowserThread::FILE), 75 : file_thread_(BrowserThread::FILE),
76 profile_(new TestingProfile()) { 76 profile_(new TestingProfile()) {
77 target_ = BuildSpellCheckProfileWith(profile_.get()); 77 target_ = BuildSpellCheckProfileWith(profile_.get());
78 } 78 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 expected2.push_back("fuga"); 271 expected2.push_back("fuga");
272 272
273 SpellCheckProfile::CustomWordList actual1; 273 SpellCheckProfile::CustomWordList actual1;
274 target_->LoadCustomDictionary(&actual1); 274 target_->LoadCustomDictionary(&actual1);
275 EXPECT_EQ(actual1, expected1); 275 EXPECT_EQ(actual1, expected1);
276 276
277 SpellCheckProfile::CustomWordList actual2; 277 SpellCheckProfile::CustomWordList actual2;
278 target2->LoadCustomDictionary(&actual2); 278 target2->LoadCustomDictionary(&actual2);
279 EXPECT_EQ(actual2, expected2); 279 EXPECT_EQ(actual2, expected2);
280 } 280 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_tracker_unittest.cc ('k') | chrome/browser/sync/abstract_profile_sync_service_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698