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

Side by Side Diff: base/prefs/json_pref_store_unittest.cc

Issue 11243002: Move the bits of Prefs where production code has only trivially easy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, fix gypi problem Created 8 years, 2 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
« no previous file with comments | « base/prefs/json_pref_store.cc ('k') | base/prefs/overlay_user_pref_store.h » ('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 (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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/prefs/json_pref_store.h"
11 #include "base/scoped_temp_dir.h" 12 #include "base/scoped_temp_dir.h"
12 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
13 #include "base/string_util.h" 14 #include "base/string_util.h"
14 #include "base/threading/thread.h" 15 #include "base/threading/thread.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 #include "chrome/common/chrome_paths.h" 18 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/json_pref_store.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "testing/gmock/include/gmock/gmock.h" 20 #include "testing/gmock/include/gmock/gmock.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 22
23 namespace { 23 namespace {
24 24
25 class MockPrefStoreObserver : public PrefStore::Observer { 25 class MockPrefStoreObserver : public PrefStore::Observer {
26 public: 26 public:
27 MOCK_METHOD1(OnPrefValueChanged, void (const std::string&)); 27 MOCK_METHOD1(OnPrefValueChanged, void (const std::string&));
28 MOCK_METHOD1(OnInitializationCompleted, void (bool)); 28 MOCK_METHOD1(OnInitializationCompleted, void (bool));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Write to file. 284 // Write to file.
285 pref_store->CommitPendingWrite(); 285 pref_store->CommitPendingWrite();
286 MessageLoop::current()->RunAllPending(); 286 MessageLoop::current()->RunAllPending();
287 287
288 // Compare to expected output. 288 // Compare to expected output.
289 FilePath golden_output_file = 289 FilePath golden_output_file =
290 data_dir_.AppendASCII("write.golden.need_empty_value.json"); 290 data_dir_.AppendASCII("write.golden.need_empty_value.json");
291 ASSERT_TRUE(file_util::PathExists(golden_output_file)); 291 ASSERT_TRUE(file_util::PathExists(golden_output_file));
292 EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file)); 292 EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file));
293 } 293 }
OLDNEW
« no previous file with comments | « base/prefs/json_pref_store.cc ('k') | base/prefs/overlay_user_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698