| 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 "base/prefs/json_pref_store.h" | 5 #include "components/prefs/json_pref_store.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 19 #include "base/metrics/histogram_samples.h" | 19 #include "base/metrics/histogram_samples.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/prefs/pref_filter.h" | |
| 22 #include "base/run_loop.h" | 21 #include "base/run_loop.h" |
| 23 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
| 24 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 27 #include "base/test/histogram_tester.h" | 26 #include "base/test/histogram_tester.h" |
| 28 #include "base/test/simple_test_clock.h" | 27 #include "base/test/simple_test_clock.h" |
| 29 #include "base/threading/sequenced_worker_pool.h" | 28 #include "base/threading/sequenced_worker_pool.h" |
| 30 #include "base/threading/thread.h" | 29 #include "base/threading/thread.h" |
| 31 #include "base/values.h" | 30 #include "base/values.h" |
| 31 #include "components/prefs/pref_filter.h" |
| 32 #include "testing/gmock/include/gmock/gmock.h" | 32 #include "testing/gmock/include/gmock/gmock.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 | 34 |
| 35 namespace base { | 35 namespace base { |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 const char kHomePage[] = "homepage"; | 38 const char kHomePage[] = "homepage"; |
| 39 | 39 |
| 40 const char kReadJson[] = | 40 const char kReadJson[] = |
| 41 "{\n" | 41 "{\n" |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 ASSERT_TRUE(file_writer->HasPendingWrite()); | 953 ASSERT_TRUE(file_writer->HasPendingWrite()); |
| 954 | 954 |
| 955 // Call CommitPendingWrite and check that the lossy pref is there with the | 955 // Call CommitPendingWrite and check that the lossy pref is there with the |
| 956 // last value set above. | 956 // last value set above. |
| 957 pref_store->CommitPendingWrite(); | 957 pref_store->CommitPendingWrite(); |
| 958 ASSERT_FALSE(file_writer->HasPendingWrite()); | 958 ASSERT_FALSE(file_writer->HasPendingWrite()); |
| 959 ASSERT_EQ("{\"lossy\":\"lossy\"}", GetTestFileContents()); | 959 ASSERT_EQ("{\"lossy\":\"lossy\"}", GetTestFileContents()); |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace base | 962 } // namespace base |
| OLD | NEW |