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

Side by Side Diff: sync/internal_api/sync_manager_impl_unittest.cc

Issue 1539843002: Convert Pass()→std::move() in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up 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
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 // Unit tests for the SyncApi. Note that a lot of the underlying 5 // Unit tests for the SyncApi. Note that a lot of the underlying
6 // functionality is provided by the Syncable layer, which has its own 6 // functionality is provided by the Syncable layer, which has its own
7 // unit tests. We'll test SyncApi specific things in this harness. 7 // unit tests. We'll test SyncApi specific things in this harness.
8 8
9 #include "sync/internal_api/sync_manager_impl.h"
10
9 #include <stdint.h> 11 #include <stdint.h>
10
11 #include <cstddef> 12 #include <cstddef>
12 #include <map> 13 #include <map>
14 #include <utility>
13 15
14 #include "base/callback.h" 16 #include "base/callback.h"
15 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
16 #include "base/files/scoped_temp_dir.h" 18 #include "base/files/scoped_temp_dir.h"
17 #include "base/format_macros.h" 19 #include "base/format_macros.h"
18 #include "base/location.h" 20 #include "base/location.h"
19 #include "base/memory/scoped_ptr.h" 21 #include "base/memory/scoped_ptr.h"
20 #include "base/run_loop.h" 22 #include "base/run_loop.h"
21 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
(...skipping 12 matching lines...) Expand all
35 #include "sync/internal_api/public/http_post_provider_factory.h" 37 #include "sync/internal_api/public/http_post_provider_factory.h"
36 #include "sync/internal_api/public/http_post_provider_interface.h" 38 #include "sync/internal_api/public/http_post_provider_interface.h"
37 #include "sync/internal_api/public/read_node.h" 39 #include "sync/internal_api/public/read_node.h"
38 #include "sync/internal_api/public/read_transaction.h" 40 #include "sync/internal_api/public/read_transaction.h"
39 #include "sync/internal_api/public/test/test_entry_factory.h" 41 #include "sync/internal_api/public/test/test_entry_factory.h"
40 #include "sync/internal_api/public/test/test_internal_components_factory.h" 42 #include "sync/internal_api/public/test/test_internal_components_factory.h"
41 #include "sync/internal_api/public/test/test_user_share.h" 43 #include "sync/internal_api/public/test/test_user_share.h"
42 #include "sync/internal_api/public/write_node.h" 44 #include "sync/internal_api/public/write_node.h"
43 #include "sync/internal_api/public/write_transaction.h" 45 #include "sync/internal_api/public/write_transaction.h"
44 #include "sync/internal_api/sync_encryption_handler_impl.h" 46 #include "sync/internal_api/sync_encryption_handler_impl.h"
45 #include "sync/internal_api/sync_manager_impl.h"
46 #include "sync/internal_api/syncapi_internal.h" 47 #include "sync/internal_api/syncapi_internal.h"
47 #include "sync/js/js_backend.h" 48 #include "sync/js/js_backend.h"
48 #include "sync/js/js_event_handler.h" 49 #include "sync/js/js_event_handler.h"
49 #include "sync/js/js_test_util.h" 50 #include "sync/js/js_test_util.h"
50 #include "sync/protocol/bookmark_specifics.pb.h" 51 #include "sync/protocol/bookmark_specifics.pb.h"
51 #include "sync/protocol/encryption.pb.h" 52 #include "sync/protocol/encryption.pb.h"
52 #include "sync/protocol/extension_specifics.pb.h" 53 #include "sync/protocol/extension_specifics.pb.h"
53 #include "sync/protocol/password_specifics.pb.h" 54 #include "sync/protocol/password_specifics.pb.h"
54 #include "sync/protocol/preference_specifics.pb.h" 55 #include "sync/protocol/preference_specifics.pb.h"
55 #include "sync/protocol/proto_value_conversions.h" 56 #include "sync/protocol/proto_value_conversions.h"
(...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 switches, InternalComponentsFactory::STORAGE_IN_MEMORY, storage_used), 2543 switches, InternalComponentsFactory::STORAGE_IN_MEMORY, storage_used),
2543 scheduler_to_use_(scheduler_to_use), 2544 scheduler_to_use_(scheduler_to_use),
2544 session_context_(session_context) {} 2545 session_context_(session_context) {}
2545 ~ComponentsFactory() override {} 2546 ~ComponentsFactory() override {}
2546 2547
2547 scoped_ptr<SyncScheduler> BuildScheduler( 2548 scoped_ptr<SyncScheduler> BuildScheduler(
2548 const std::string& name, 2549 const std::string& name,
2549 sessions::SyncSessionContext* context, 2550 sessions::SyncSessionContext* context,
2550 CancelationSignal* stop_handle) override { 2551 CancelationSignal* stop_handle) override {
2551 *session_context_ = context; 2552 *session_context_ = context;
2552 return scheduler_to_use_.Pass(); 2553 return std::move(scheduler_to_use_);
2553 } 2554 }
2554 2555
2555 private: 2556 private:
2556 scoped_ptr<SyncScheduler> scheduler_to_use_; 2557 scoped_ptr<SyncScheduler> scheduler_to_use_;
2557 sessions::SyncSessionContext** session_context_; 2558 sessions::SyncSessionContext** session_context_;
2558 }; 2559 };
2559 2560
2560 class SyncManagerTestWithMockScheduler : public SyncManagerTest { 2561 class SyncManagerTestWithMockScheduler : public SyncManagerTest {
2561 public: 2562 public:
2562 SyncManagerTestWithMockScheduler() : scheduler_(NULL) {} 2563 SyncManagerTestWithMockScheduler() : scheduler_(NULL) {}
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 // SyncManagerInitInvalidStorageTest::GetFactory will return 3359 // SyncManagerInitInvalidStorageTest::GetFactory will return
3359 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. 3360 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails.
3360 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's 3361 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's
3361 // task is to ensure that SyncManagerImpl reported initialization failure in 3362 // task is to ensure that SyncManagerImpl reported initialization failure in
3362 // OnInitializationComplete callback. 3363 // OnInitializationComplete callback.
3363 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { 3364 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) {
3364 EXPECT_FALSE(initialization_succeeded_); 3365 EXPECT_FALSE(initialization_succeeded_);
3365 } 3366 }
3366 3367
3367 } // namespace syncer 3368 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698