Index: sync/test/mock_transaction_observer.h |
diff --git a/sync/test/mock_transaction_observer.h b/sync/test/mock_transaction_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a197c614d70342fa85f826a97cec993a45d62b58 |
--- /dev/null |
+++ b/sync/test/mock_transaction_observer.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ |
+#define SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "sync/internal_api/public/base/model_type.h" |
+#include "sync/syncable/transaction_observer.h" |
+#include "sync/syncable/write_transaction_info.h" |
+ |
+namespace syncer { |
+namespace syncable { |
+ |
+class MockTransactionObserver : |
Nicolas Zea
2012/09/13 00:45:55
comment about purpose of the class
rlarocque
2012/09/14 01:03:07
Done.
|
+ public base::SupportsWeakPtr<MockTransactionObserver>, |
+ public TransactionObserver { |
+ public: |
+ MockTransactionObserver(); |
+ virtual void OnTransactionWrite( |
+ const ImmutableWriteTransactionInfo& write_transaction_info, |
+ ModelTypeSet models_with_changes) OVERRIDE; |
+ |
+ int transactions_observed(); |
+ |
+ protected: |
+ virtual ~MockTransactionObserver(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(MockTransactionObserver); |
+ |
+ base::WeakPtrFactory<MockTransactionObserver> weak_ptr_factory_; |
Nicolas Zea
2012/09/13 00:45:55
weak ptr factory and SupportsWeakPtr?
rlarocque
2012/09/14 01:03:07
Whoops. Fixed.
|
+ int transactions_observed_; |
+}; |
+ |
+} // namespace syncable |
+} // namespace syncer |
+ |
+ |
+#endif // SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_ |