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

Side by Side Diff: chrome/browser/sync/startup_controller_unittest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/sync/startup_controller.h" 5 #include "chrome/browser/sync/startup_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }; 48 };
49 49
50 class StartupControllerTest : public testing::Test { 50 class StartupControllerTest : public testing::Test {
51 public: 51 public:
52 StartupControllerTest() : started_(false) {} 52 StartupControllerTest() : started_(false) {}
53 53
54 void SetUp() override { 54 void SetUp() override {
55 profile_.reset(new TestingProfile()); 55 profile_.reset(new TestingProfile());
56 sync_prefs_.reset(new sync_driver::SyncPrefs(profile_->GetPrefs())); 56 sync_prefs_.reset(new sync_driver::SyncPrefs(profile_->GetPrefs()));
57 token_service_.reset(static_cast<FakeProfileOAuth2TokenService*>( 57 token_service_.reset(static_cast<FakeProfileOAuth2TokenService*>(
58 BuildFakeProfileOAuth2TokenService(profile_.get()))); 58 BuildFakeProfileOAuth2TokenService(profile_.get()).release()));
59 signin_.reset(new FakeSupervisedUserSigninManagerWrapper()); 59 signin_.reset(new FakeSupervisedUserSigninManagerWrapper());
60 60
61 ProfileSyncServiceStartBehavior behavior = 61 ProfileSyncServiceStartBehavior behavior =
62 browser_defaults::kSyncAutoStarts ? AUTO_START : MANUAL_START; 62 browser_defaults::kSyncAutoStarts ? AUTO_START : MANUAL_START;
63 base::Closure fake_start_backend = base::Bind( 63 base::Closure fake_start_backend = base::Bind(
64 &StartupControllerTest::FakeStartBackend, base::Unretained(this)); 64 &StartupControllerTest::FakeStartBackend, base::Unretained(this));
65 controller_.reset(new StartupController(behavior, token_service(), 65 controller_.reset(new StartupController(behavior, token_service(),
66 sync_prefs_.get(), signin_.get(), 66 sync_prefs_.get(), signin_.get(),
67 fake_start_backend)); 67 fake_start_backend));
68 controller_->Reset(syncer::UserTypes()); 68 controller_->Reset(syncer::UserTypes());
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 controller()->set_setup_in_progress(true); 254 controller()->set_setup_in_progress(true);
255 255
256 // This could happen if the UI triggers a stop-syncing permanently call. 256 // This could happen if the UI triggers a stop-syncing permanently call.
257 controller()->Reset(syncer::UserTypes()); 257 controller()->Reset(syncer::UserTypes());
258 258
259 // From the UI's point of view, setup is still in progress. 259 // From the UI's point of view, setup is still in progress.
260 EXPECT_TRUE(controller()->setup_in_progress()); 260 EXPECT_TRUE(controller()->setup_in_progress());
261 } 261 }
262 262
263 } // namespace browser_sync 263 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/sync/sync_error_notifier_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698