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

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

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/histogram_samples.h" 10 #include "base/metrics/histogram_samples.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 word = *it; 46 word = *it;
47 sync_pb::EntitySpecifics specifics; 47 sync_pb::EntitySpecifics specifics;
48 specifics.mutable_dictionary()->set_word(word); 48 specifics.mutable_dictionary()->set_word(word);
49 data.push_back(syncer::SyncData::CreateLocalData(word, word, specifics)); 49 data.push_back(syncer::SyncData::CreateLocalData(word, word, specifics));
50 } 50 }
51 return data; 51 return data;
52 } 52 }
53 53
54 } // namespace 54 } // namespace
55 55
56 static ProfileKeyedService* BuildSpellcheckService(Profile* profile) { 56 static ProfileKeyedService* BuildSpellcheckService(
57 return new SpellcheckService(profile); 57 content::BrowserContext* profile) {
58 return new SpellcheckService(static_cast<Profile*>(profile));
58 } 59 }
59 60
60 class SpellcheckCustomDictionaryTest : public testing::Test { 61 class SpellcheckCustomDictionaryTest : public testing::Test {
61 protected: 62 protected:
62 SpellcheckCustomDictionaryTest() 63 SpellcheckCustomDictionaryTest()
63 : ui_thread_(BrowserThread::UI, &message_loop_), 64 : ui_thread_(BrowserThread::UI, &message_loop_),
64 file_thread_(BrowserThread::FILE, &message_loop_), 65 file_thread_(BrowserThread::FILE, &message_loop_),
65 profile_(new TestingProfile) { 66 profile_(new TestingProfile) {
66 } 67 }
67 68
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 EXPECT_EQ(2u, loaded_custom_words.size()); 1119 EXPECT_EQ(2u, loaded_custom_words.size());
1119 1120
1120 histogram = 1121 histogram =
1121 StatisticsRecorder::FindHistogram("SpellCheck.CustomWords"); 1122 StatisticsRecorder::FindHistogram("SpellCheck.CustomWords");
1122 ASSERT_TRUE(histogram != NULL); 1123 ASSERT_TRUE(histogram != NULL);
1123 scoped_ptr<HistogramSamples> samples2 = histogram->SnapshotSamples(); 1124 scoped_ptr<HistogramSamples> samples2 = histogram->SnapshotSamples();
1124 1125
1125 samples2->Subtract(*baseline); 1126 samples2->Subtract(*baseline);
1126 EXPECT_EQ(2,samples2->sum()); 1127 EXPECT_EQ(2,samples2->sum());
1127 } 1128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698