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

Unified Diff: chrome/browser/sync/api/sync_data.cc

Issue 7978044: Sync/Valgrind: Add gmock printers for SyncChange, SyncData, SyncError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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: chrome/browser/sync/api/sync_data.cc
diff --git a/chrome/browser/sync/api/sync_data.cc b/chrome/browser/sync/api/sync_data.cc
index 1c2d4967423cc72cb69288fdb3a7fe96d807d96e..cc7ad6be1be33ad583fa6f7be3a6e6873b09930d 100644
--- a/chrome/browser/sync/api/sync_data.cc
+++ b/chrome/browser/sync/api/sync_data.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/api/sync_data.h"
+#include <iostream>
+
#include "chrome/browser/sync/internal_api/base_node.h"
#include "chrome/browser/sync/protocol/sync.pb.h"
@@ -102,3 +104,15 @@ int64 SyncData::GetRemoteId() const {
bool SyncData::IsLocal() const {
return id_ == sync_api::kInvalidId;
}
+
+std::ostream& operator<<(::std::ostream& os,
+ const SyncData& sync_data) {
+ int64 id = (sync_data.IsLocal()) ? 0L : sync_data.GetRemoteId();
+ return os <<
+ "{" << id <<
+ ", " << sync_data.IsValid() <<
+ ", " << sync_data.GetDataType() <<
+ ", " << sync_data.GetTag() <<
akalin 2011/09/21 23:12:58 print out specifics also: use EntitySpecificsToVal
James Hawkins 2011/09/22 01:15:26 Done.
+ ", " << sync_data.GetTitle() <<
akalin 2011/09/21 23:12:58 print out IsLocal(), too. Also note that GetTag()
James Hawkins 2011/09/22 01:15:26 Done.
+ "}";
+}

Powered by Google App Engine
This is Rietveld 408576698