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

Side by Side Diff: chrome/browser/sync/api/sync_change.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/api/sync_change.h" 5 #include "chrome/browser/sync/api/sync_change.h"
6 6
7 #include <iostream>
8
7 SyncChange::SyncChange() : change_type_(ACTION_INVALID) { 9 SyncChange::SyncChange() : change_type_(ACTION_INVALID) {
8 } 10 }
9 11
10 SyncChange::SyncChange(SyncChangeType change_type, const SyncData& sync_data) 12 SyncChange::SyncChange(SyncChangeType change_type, const SyncData& sync_data)
11 : change_type_(change_type), 13 : change_type_(change_type),
12 sync_data_(sync_data) { 14 sync_data_(sync_data) {
13 DCHECK(IsValid()); 15 DCHECK(IsValid());
14 } 16 }
15 17
16 SyncChange::~SyncChange() {} 18 SyncChange::~SyncChange() {}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return "ACTION_ADD"; 54 return "ACTION_ADD";
53 case ACTION_UPDATE: 55 case ACTION_UPDATE:
54 return "ACTION_UPDATE"; 56 return "ACTION_UPDATE";
55 case ACTION_DELETE: 57 case ACTION_DELETE:
56 return "ACTION_DELETE"; 58 return "ACTION_DELETE";
57 default: 59 default:
58 NOTREACHED(); 60 NOTREACHED();
59 } 61 }
60 return std::string(); 62 return std::string();
61 } 63 }
64
65 std::ostream& operator<<(::std::ostream& os,
66 const SyncChange& sync_change) {
67 return os <<
68 "{" << sync_change.change_type() <<
akalin 2011/09/21 23:12:58 use ChangeTypeToString
James Hawkins 2011/09/22 01:15:26 Done.
69 ", " << sync_change.sync_data() <<
70 "}";
71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698