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

Unified Diff: sync/test/mock_transaction_observer.h

Issue 10911073: NOT FOR COMMIT: Add DeviceInfo type and ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes from review comments Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
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..30764f2b5d412bdb0a7afa66fff186b83f4d5f41
--- /dev/null
+++ b/sync/test/mock_transaction_observer.h
@@ -0,0 +1,40 @@
+// 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 {
+
+// This class acts as a TransactionObserver for the syncable::Directory.
+// 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
+class MockTransactionObserver :
+ public base::SupportsWeakPtr<MockTransactionObserver>,
+ public TransactionObserver {
+ public:
+ MockTransactionObserver();
+ virtual ~MockTransactionObserver();
+ virtual void OnTransactionWrite(
+ const ImmutableWriteTransactionInfo& write_transaction_info,
+ ModelTypeSet models_with_changes) OVERRIDE;
+
+ int transactions_observed();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockTransactionObserver);
+
+ int transactions_observed_;
+};
+
+} // namespace syncable
+} // namespace syncer
+
+
+#endif // SYNC_TEST_MOCK_TRANSACTION_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698