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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_worker_unittest.cc

Issue 1545283002: Convert Pass()→std::move() in //chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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_file_system/drive_backend/sync_worker.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h"
6 6
7 #include <utility>
8
7 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
8 #include "base/location.h" 10 #include "base/location.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/run_loop.h" 12 #include "base/run_loop.h"
11 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
12 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
13 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
14 #include "chrome/browser/extensions/test_extension_service.h" 16 #include "chrome/browser/extensions/test_extension_service.h"
15 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" 17 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h"
16 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" 18 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ~SyncWorkerTest() override {} 105 ~SyncWorkerTest() override {}
104 106
105 void SetUp() override { 107 void SetUp() override {
106 ASSERT_TRUE(profile_dir_.CreateUniqueTempDir()); 108 ASSERT_TRUE(profile_dir_.CreateUniqueTempDir());
107 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); 109 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default()));
108 110
109 extension_service_.reset(new MockExtensionService); 111 extension_service_.reset(new MockExtensionService);
110 scoped_ptr<drive::DriveServiceInterface> 112 scoped_ptr<drive::DriveServiceInterface>
111 fake_drive_service(new drive::FakeDriveService); 113 fake_drive_service(new drive::FakeDriveService);
112 114
113 scoped_ptr<SyncEngineContext> 115 scoped_ptr<SyncEngineContext> sync_engine_context(new SyncEngineContext(
114 sync_engine_context(new SyncEngineContext( 116 std::move(fake_drive_service), nullptr /* drive_uploader */,
115 fake_drive_service.Pass(), 117 nullptr /* task_logger */,
116 nullptr /* drive_uploader */, 118 base::ThreadTaskRunnerHandle::Get() /* ui_task_runner */,
117 nullptr /* task_logger */, 119 base::ThreadTaskRunnerHandle::Get() /* worker_task_runner */,
118 base::ThreadTaskRunnerHandle::Get() /* ui_task_runner */, 120 nullptr /* worker_pool */));
119 base::ThreadTaskRunnerHandle::Get() /* worker_task_runner */,
120 nullptr /* worker_pool */));
121 121
122 sync_worker_.reset(new SyncWorker( 122 sync_worker_.reset(new SyncWorker(
123 profile_dir_.path(), 123 profile_dir_.path(),
124 extension_service_->AsWeakPtr(), 124 extension_service_->AsWeakPtr(),
125 in_memory_env_.get())); 125 in_memory_env_.get()));
126 sync_worker_->Initialize(sync_engine_context.Pass()); 126 sync_worker_->Initialize(std::move(sync_engine_context));
127 127
128 sync_worker_->SetSyncEnabled(true); 128 sync_worker_->SetSyncEnabled(true);
129 base::RunLoop().RunUntilIdle(); 129 base::RunLoop().RunUntilIdle();
130 } 130 }
131 131
132 void TearDown() override { 132 void TearDown() override {
133 sync_worker_.reset(); 133 sync_worker_.reset();
134 extension_service_.reset(); 134 extension_service_.reset();
135 base::RunLoop().RunUntilIdle(); 135 base::RunLoop().RunUntilIdle();
136 } 136 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 base::Bind(&SyncWorkerTest::CheckServiceState, 380 base::Bind(&SyncWorkerTest::CheckServiceState,
381 AsWeakPtr(), 381 AsWeakPtr(),
382 SYNC_STATUS_OK, 382 SYNC_STATUS_OK,
383 REMOTE_SERVICE_OK)); 383 REMOTE_SERVICE_OK));
384 384
385 base::RunLoop().RunUntilIdle(); 385 base::RunLoop().RunUntilIdle();
386 } 386 }
387 387
388 } // namespace drive_backend 388 } // namespace drive_backend
389 } // namespace sync_file_system 389 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698