OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |