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

Side by Side Diff: sync/test/fake_server/fake_server_verifier.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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
« no previous file with comments | « sync/syncable/nigori_util.cc ('k') | sync/tools/sync_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sync/test/fake_server/fake_server_verifier.h" 5 #include "sync/test/fake_server/fake_server_verifier.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "sync/internal_api/public/base/model_type.h" 10 #include "sync/internal_api/public/base/model_type.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 return AssertionFailure() << "Sessions hierarchies are not equal. " 47 return AssertionFailure() << "Sessions hierarchies are not equal. "
48 << "FakeServer contents: " << actual.ToString() 48 << "FakeServer contents: " << actual.ToString()
49 << "; Expected contents: " << expected.ToString(); 49 << "; Expected contents: " << expected.ToString();
50 } 50 }
51 51
52 // Caller maintains ownership of |entities|. 52 // Caller maintains ownership of |entities|.
53 string ConvertFakeServerContentsToString( 53 string ConvertFakeServerContentsToString(
54 const base::DictionaryValue& entities) { 54 const base::DictionaryValue& entities) {
55 string entities_str; 55 string entities_str;
56 if (!JSONWriter::WriteWithOptions(&entities, 56 if (!JSONWriter::WriteWithOptions(entities, JSONWriter::OPTIONS_PRETTY_PRINT,
57 JSONWriter::OPTIONS_PRETTY_PRINT,
58 &entities_str)) { 57 &entities_str)) {
59 entities_str = "Could not convert FakeServer contents to string."; 58 entities_str = "Could not convert FakeServer contents to string.";
60 } 59 }
61 return "FakeServer contents:\n" + entities_str; 60 return "FakeServer contents:\n" + entities_str;
62 } 61 }
63 62
64 } // namespace 63 } // namespace
65 64
66 FakeServerVerifier::FakeServerVerifier(FakeServer* fake_server) 65 FakeServerVerifier::FakeServerVerifier(FakeServer* fake_server)
67 : fake_server_(fake_server) { } 66 : fake_server_(fake_server) { }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return AssertionFailure() << "Malformed data: Tab entity not found."; 176 return AssertionFailure() << "Malformed data: Tab entity not found.";
178 } 177 }
179 tab_urls.insert(tab_ids_to_urls[tab_id]); 178 tab_urls.insert(tab_ids_to_urls[tab_id]);
180 } 179 }
181 actual_sessions.AddWindow(tab_urls); 180 actual_sessions.AddWindow(tab_urls);
182 } 181 }
183 return VerifySessionsHierarchyEquality(expected_sessions, actual_sessions); 182 return VerifySessionsHierarchyEquality(expected_sessions, actual_sessions);
184 } 183 }
185 184
186 } // namespace fake_server 185 } // namespace fake_server
OLDNEW
« no previous file with comments | « sync/syncable/nigori_util.cc ('k') | sync/tools/sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698