Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ | |
| 6 #define SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "sync/internal_api/public/base/model_type.h" | |
| 10 #include "sync/syncable/transaction_observer.h" | |
| 11 #include "sync/syncable/write_transaction_info.h" | |
| 12 | |
| 13 namespace syncer { | |
| 14 namespace syncable { | |
| 15 | |
| 16 // This class acts as a TransactionObserver for the syncable::Directory. | |
| 17 // It gathers information that is useful for writing test assertions. | |
|
Nicolas Zea
2012/09/14 19:15:08
mention that it only counts transactions with sync
rlarocque
2012/09/15 01:36:37
I added a comment to the transactions_observed() m
| |
| 18 class MockTransactionObserver : | |
| 19 public base::SupportsWeakPtr<MockTransactionObserver>, | |
| 20 public TransactionObserver { | |
| 21 public: | |
| 22 MockTransactionObserver(); | |
| 23 virtual ~MockTransactionObserver(); | |
| 24 virtual void OnTransactionWrite( | |
| 25 const ImmutableWriteTransactionInfo& write_transaction_info, | |
| 26 ModelTypeSet models_with_changes) OVERRIDE; | |
| 27 | |
| 28 int transactions_observed(); | |
| 29 | |
| 30 private: | |
| 31 DISALLOW_COPY_AND_ASSIGN(MockTransactionObserver); | |
| 32 | |
| 33 int transactions_observed_; | |
| 34 }; | |
| 35 | |
| 36 } // namespace syncable | |
| 37 } // namespace syncer | |
| 38 | |
| 39 | |
| 40 #endif // SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ | |
| OLD | NEW |