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

Side by Side Diff: chrome/browser/sync/test/integration/extension_settings_helper.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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) 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/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 using content::BrowserThread; 22 using content::BrowserThread;
23 using extensions::SettingsStorage; 23 using extensions::SettingsStorage;
24 using sync_datatype_helper::test; 24 using sync_datatype_helper::test;
25 25
26 namespace extension_settings_helper { 26 namespace extension_settings_helper {
27 27
28 namespace { 28 namespace {
29 29
30 std::string ToJson(const Value& value) { 30 std::string ToJson(const Value& value) {
31 std::string json; 31 std::string json;
32 base::JSONWriter::Write(&value, true /* pretty print */, &json); 32 base::JSONWriter::WriteWithOptions(&value,
33 base::JSONWriter::OPTIONS_PRETTY_PRINT,
34 &json);
33 return json; 35 return json;
34 } 36 }
35 37
36 void GetAllSettingsOnFileThread( 38 void GetAllSettingsOnFileThread(
37 scoped_ptr<DictionaryValue>* out, 39 scoped_ptr<DictionaryValue>* out,
38 base::WaitableEvent* signal, 40 base::WaitableEvent* signal,
39 SettingsStorage* storage) { 41 SettingsStorage* storage) {
40 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 42 CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
41 out->reset(storage->Get().settings().DeepCopy()); 43 out->reset(storage->Get().settings().DeepCopy());
42 signal->Signal(); 44 signal->Signal();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 bool all_profiles_same = true; 112 bool all_profiles_same = true;
111 for (int i = 0; i < test()->num_clients(); ++i) { 113 for (int i = 0; i < test()->num_clients(); ++i) {
112 // &= so that all profiles are tested; analogous to EXPECT over ASSERT. 114 // &= so that all profiles are tested; analogous to EXPECT over ASSERT.
113 all_profiles_same &= 115 all_profiles_same &=
114 AreSettingsSame(test()->verifier(), test()->GetProfile(i)); 116 AreSettingsSame(test()->verifier(), test()->GetProfile(i));
115 } 117 }
116 return all_profiles_same; 118 return all_profiles_same;
117 } 119 }
118 120
119 } // namespace extension_settings_helper 121 } // namespace extension_settings_helper
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | chrome/browser/translate/translate_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698