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

Side by Side Diff: chrome/browser/sync/test/integration/extension_settings_helper.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test/integration/extension_settings_helper.h" 5 #include "chrome/browser/sync/test/integration/extension_settings_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 13 matching lines...) Expand all
24 using content::BrowserThread; 24 using content::BrowserThread;
25 using extensions::ExtensionRegistry; 25 using extensions::ExtensionRegistry;
26 using sync_datatype_helper::test; 26 using sync_datatype_helper::test;
27 27
28 namespace extension_settings_helper { 28 namespace extension_settings_helper {
29 29
30 namespace { 30 namespace {
31 31
32 std::string ToJson(const base::Value& value) { 32 std::string ToJson(const base::Value& value) {
33 std::string json; 33 std::string json;
34 base::JSONWriter::WriteWithOptions(&value, 34 base::JSONWriter::WriteWithOptions(
35 base::JSONWriter::OPTIONS_PRETTY_PRINT, 35 value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
36 &json);
37 return json; 36 return json;
38 } 37 }
39 38
40 void GetAllSettingsOnFileThread(base::DictionaryValue* out, 39 void GetAllSettingsOnFileThread(base::DictionaryValue* out,
41 base::WaitableEvent* signal, 40 base::WaitableEvent* signal,
42 ValueStore* storage) { 41 ValueStore* storage) {
43 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 42 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
44 out->Swap(&storage->Get()->settings()); 43 out->Swap(&storage->Get()->settings());
45 signal->Signal(); 44 signal->Signal();
46 } 45 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool all_profiles_same = true; 117 bool all_profiles_same = true;
119 for (int i = 0; i < test()->num_clients(); ++i) { 118 for (int i = 0; i < test()->num_clients(); ++i) {
120 // &= so that all profiles are tested; analogous to EXPECT over ASSERT. 119 // &= so that all profiles are tested; analogous to EXPECT over ASSERT.
121 all_profiles_same &= 120 all_profiles_same &=
122 AreSettingsSame(test()->verifier(), test()->GetProfile(i)); 121 AreSettingsSame(test()->verifier(), test()->GetProfile(i));
123 } 122 }
124 return all_profiles_same; 123 return all_profiles_same;
125 } 124 }
126 125
127 } // namespace extension_settings_helper 126 } // namespace extension_settings_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698