OLD | NEW |
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 #include "components/sync/test/engine/test_directory_setter_upper.h" | 5 #include "components/sync/test/engine/test_directory_setter_upper.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 directory_.reset(new syncable::Directory( | 30 directory_.reset(new syncable::Directory( |
31 new syncable::InMemoryDirectoryBackingStore(name_), | 31 new syncable::InMemoryDirectoryBackingStore(name_), |
32 MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), | 32 MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), |
33 &encryption_handler_, encryption_handler_.cryptographer())); | 33 &encryption_handler_, encryption_handler_.cryptographer())); |
34 ASSERT_EQ(syncable::OPENED, | 34 ASSERT_EQ(syncable::OPENED, |
35 directory_->Open(name_, &delegate_, transaction_observer)); | 35 directory_->Open(name_, &delegate_, transaction_observer)); |
36 } | 36 } |
37 | 37 |
38 void TestDirectorySetterUpper::SetUpWith( | 38 void TestDirectorySetterUpper::SetUpWith( |
39 syncer::syncable::DirectoryBackingStore* directory_store) { | 39 syncable::DirectoryBackingStore* directory_store) { |
40 CHECK(directory_store); | 40 CHECK(directory_store); |
41 test_transaction_observer_.reset(new syncable::TestTransactionObserver()); | 41 test_transaction_observer_.reset(new syncable::TestTransactionObserver()); |
42 WeakHandle<syncable::TransactionObserver> transaction_observer = | 42 WeakHandle<syncable::TransactionObserver> transaction_observer = |
43 MakeWeakHandle(test_transaction_observer_->AsWeakPtr()); | 43 MakeWeakHandle(test_transaction_observer_->AsWeakPtr()); |
44 | 44 |
45 directory_.reset(new syncable::Directory( | 45 directory_.reset(new syncable::Directory( |
46 directory_store, MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), | 46 directory_store, MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), |
47 &encryption_handler_, encryption_handler_.cryptographer())); | 47 &encryption_handler_, encryption_handler_.cryptographer())); |
48 ASSERT_EQ(syncable::OPENED, | 48 ASSERT_EQ(syncable::OPENED, |
49 directory_->Open(name_, &delegate_, transaction_observer)); | 49 directory_->Open(name_, &delegate_, transaction_observer)); |
(...skipping 14 matching lines...) Expand all Loading... |
64 void TestDirectorySetterUpper::RunInvariantCheck() { | 64 void TestDirectorySetterUpper::RunInvariantCheck() { |
65 // Check invariants for all items. | 65 // Check invariants for all items. |
66 syncable::ReadTransaction trans(FROM_HERE, directory()); | 66 syncable::ReadTransaction trans(FROM_HERE, directory()); |
67 | 67 |
68 // The TestUnrecoverableErrorHandler that this directory was constructed with | 68 // The TestUnrecoverableErrorHandler that this directory was constructed with |
69 // will handle error reporting, so we can safely ignore the return value. | 69 // will handle error reporting, so we can safely ignore the return value. |
70 directory()->FullyCheckTreeInvariants(&trans); | 70 directory()->FullyCheckTreeInvariants(&trans); |
71 } | 71 } |
72 | 72 |
73 } // namespace syncer | 73 } // namespace syncer |
OLD | NEW |