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

Side by Side Diff: sync/test/engine/test_directory_setter_upper.h

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (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 // A handy class that takes care of setting up and destroying a 5 // A handy class that takes care of setting up and destroying a
6 // syncable::Directory instance for unit tests that require one. 6 // syncable::Directory instance for unit tests that require one.
7 // 7 //
8 // The expected usage is to make this a component of your test fixture: 8 // The expected usage is to make this a component of your test fixture:
9 // 9 //
10 // class AwesomenessTest : public testing::Test { 10 // class AwesomenessTest : public testing::Test {
(...skipping 11 matching lines...) Expand all
22 // Then, in your tests, get at the directory like so: 22 // Then, in your tests, get at the directory like so:
23 // 23 //
24 // TEST_F(AwesomenessTest, IsMaximal) { 24 // TEST_F(AwesomenessTest, IsMaximal) {
25 // ... now use metadb_.directory() to get at syncable::Entry objects ... 25 // ... now use metadb_.directory() to get at syncable::Entry objects ...
26 // } 26 // }
27 // 27 //
28 28
29 #ifndef SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ 29 #ifndef SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_
30 #define SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ 30 #define SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_
31 31
32 #include <memory>
32 #include <string> 33 #include <string>
33 34
34 #include "base/compiler_specific.h" 35 #include "base/compiler_specific.h"
35 #include "base/macros.h" 36 #include "base/macros.h"
36 #include "base/memory/scoped_ptr.h"
37 #include "sync/test/fake_sync_encryption_handler.h" 37 #include "sync/test/fake_sync_encryption_handler.h"
38 #include "sync/test/null_directory_change_delegate.h" 38 #include "sync/test/null_directory_change_delegate.h"
39 #include "sync/util/test_unrecoverable_error_handler.h" 39 #include "sync/util/test_unrecoverable_error_handler.h"
40 #include "testing/gmock/include/gmock/gmock.h" 40 #include "testing/gmock/include/gmock/gmock.h"
41 41
42 namespace syncer { 42 namespace syncer {
43 43
44 namespace syncable { 44 namespace syncable {
45 class Directory; 45 class Directory;
46 class DirectoryBackingStore; 46 class DirectoryBackingStore;
(...skipping 21 matching lines...) Expand all
68 syncable::Directory* directory() { return directory_.get(); } 68 syncable::Directory* directory() { return directory_.get(); }
69 69
70 SyncEncryptionHandler* encryption_handler() { return &encryption_handler_; } 70 SyncEncryptionHandler* encryption_handler() { return &encryption_handler_; }
71 71
72 syncable::TestTransactionObserver* transaction_observer() { 72 syncable::TestTransactionObserver* transaction_observer() {
73 return test_transaction_observer_.get(); 73 return test_transaction_observer_.get();
74 } 74 }
75 75
76 private: 76 private:
77 syncable::NullDirectoryChangeDelegate delegate_; 77 syncable::NullDirectoryChangeDelegate delegate_;
78 scoped_ptr<syncable::TestTransactionObserver> test_transaction_observer_; 78 std::unique_ptr<syncable::TestTransactionObserver> test_transaction_observer_;
79 TestUnrecoverableErrorHandler handler_; 79 TestUnrecoverableErrorHandler handler_;
80 80
81 void RunInvariantCheck(); 81 void RunInvariantCheck();
82 82
83 FakeSyncEncryptionHandler encryption_handler_; 83 FakeSyncEncryptionHandler encryption_handler_;
84 scoped_ptr<syncable::Directory> directory_; 84 std::unique_ptr<syncable::Directory> directory_;
85 std::string name_; 85 std::string name_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(TestDirectorySetterUpper); 87 DISALLOW_COPY_AND_ASSIGN(TestDirectorySetterUpper);
88 }; 88 };
89 89
90 } // namespace syncer 90 } // namespace syncer
91 91
92 #endif // SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ 92 #endif // SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698