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

Side by Side Diff: chrome/browser/search_engines/template_url_service_sync_unittest.cc

Issue 366523002: Stop depending on chrome/browser/rlz/rlz.h from TemplateURLService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 6 years, 5 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 void TemplateURLServiceSyncTest::SetUp() { 228 void TemplateURLServiceSyncTest::SetUp() {
229 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(true); 229 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(true);
230 test_util_a_.SetUp(); 230 test_util_a_.SetUp();
231 // Use ChangeToLoadState() instead of VerifyLoad() so we don't actually pull 231 // Use ChangeToLoadState() instead of VerifyLoad() so we don't actually pull
232 // in the prepopulate data, which the sync tests don't care about (and would 232 // in the prepopulate data, which the sync tests don't care about (and would
233 // just foul them up). 233 // just foul them up).
234 test_util_a_.ChangeModelToLoadState(); 234 test_util_a_.ChangeModelToLoadState();
235 profile_b_.reset(new TestingProfile); 235 profile_b_.reset(new TestingProfile);
236 TemplateURLServiceFactory::GetInstance()-> 236 TemplateURLServiceFactory::GetInstance()->
237 RegisterUserPrefsOnBrowserContextForTest(profile_b_.get()); 237 RegisterUserPrefsOnBrowserContextForTest(profile_b_.get());
238 model_b_.reset(new TemplateURLService(profile_b_.get(), NULL)); 238 model_b_.reset(new TemplateURLService(profile_b_.get(), NULL,
239 base::Closure()));
239 model_b_->Load(); 240 model_b_->Load();
240 } 241 }
241 242
242 void TemplateURLServiceSyncTest::TearDown() { 243 void TemplateURLServiceSyncTest::TearDown() {
243 test_util_a_.TearDown(); 244 test_util_a_.TearDown();
244 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(false); 245 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(false);
245 } 246 }
246 247
247 scoped_ptr<syncer::SyncChangeProcessor> 248 scoped_ptr<syncer::SyncChangeProcessor>
248 TemplateURLServiceSyncTest::PassProcessor() { 249 TemplateURLServiceSyncTest::PassProcessor() {
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 const char kNewGUID[] = "newdefault"; 2232 const char kNewGUID[] = "newdefault";
2232 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), 2233 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"),
2233 "http://thewhat.com/{searchTerms}", 2234 "http://thewhat.com/{searchTerms}",
2234 kNewGUID)); 2235 kNewGUID));
2235 model()->SetUserSelectedDefaultSearchProvider( 2236 model()->SetUserSelectedDefaultSearchProvider(
2236 model()->GetTemplateURLForGUID(kNewGUID)); 2237 model()->GetTemplateURLForGUID(kNewGUID));
2237 2238
2238 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( 2239 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString(
2239 prefs::kSyncedDefaultSearchProviderGUID)); 2240 prefs::kSyncedDefaultSearchProviderGUID));
2240 } 2241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698