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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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( 56 static BrowserContextKeyedService* BuildSpellcheckService(
57 content::BrowserContext* profile) { 57 content::BrowserContext* profile) {
58 return new SpellcheckService(static_cast<Profile*>(profile)); 58 return new SpellcheckService(static_cast<Profile*>(profile));
59 } 59 }
60 60
61 class SpellcheckCustomDictionaryTest : public testing::Test { 61 class SpellcheckCustomDictionaryTest : public testing::Test {
62 protected: 62 protected:
63 SpellcheckCustomDictionaryTest() 63 SpellcheckCustomDictionaryTest()
64 : ui_thread_(BrowserThread::UI, &message_loop_), 64 : ui_thread_(BrowserThread::UI, &message_loop_),
65 file_thread_(BrowserThread::FILE, &message_loop_), 65 file_thread_(BrowserThread::FILE, &message_loop_),
66 profile_(new TestingProfile) { 66 profile_(new TestingProfile) {
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 EXPECT_EQ(2u, loaded_custom_words.size()); 1119 EXPECT_EQ(2u, loaded_custom_words.size());
1120 1120
1121 histogram = 1121 histogram =
1122 StatisticsRecorder::FindHistogram("SpellCheck.CustomWords"); 1122 StatisticsRecorder::FindHistogram("SpellCheck.CustomWords");
1123 ASSERT_TRUE(histogram != NULL); 1123 ASSERT_TRUE(histogram != NULL);
1124 scoped_ptr<HistogramSamples> samples2 = histogram->SnapshotSamples(); 1124 scoped_ptr<HistogramSamples> samples2 = histogram->SnapshotSamples();
1125 1125
1126 samples2->Subtract(*baseline); 1126 samples2->Subtract(*baseline);
1127 EXPECT_EQ(2,samples2->sum()); 1127 EXPECT_EQ(2,samples2->sum());
1128 } 1128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698