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

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

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/prefs/default_pref_store_unittest.cc ('k') | base/prefs/mock_pref_change_callback.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/prefs/json_pref_store.h" 5 #include "base/prefs/json_pref_store.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/metrics/histogram_samples.h" 14 #include "base/metrics/histogram_samples.h"
15 #include "base/metrics/statistics_recorder.h" 15 #include "base/metrics/statistics_recorder.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/prefs/pref_filter.h" 17 #include "base/prefs/pref_filter.h"
18 #include "base/run_loop.h" 18 #include "base/run_loop.h"
19 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
20 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/test/simple_test_clock.h" 23 #include "base/test/simple_test_clock.h"
24 #include "base/threading/sequenced_worker_pool.h" 24 #include "base/threading/sequenced_worker_pool.h"
25 #include "base/threading/thread.h" 25 #include "base/threading/thread.h"
26 #include "base/values.h" 26 #include "base/values.h"
27 #include "testing/gmock/include/gmock/gmock.h" 27 #include "testing/gtest/googlemock/include/gmock/gmock.h"
28 #include "testing/gtest/include/gtest/gtest.h" 28 #include "testing/gtest/googletest/include/gtest/gtest.h"
29 29
30 namespace base { 30 namespace base {
31 namespace { 31 namespace {
32 32
33 const char kHomePage[] = "homepage"; 33 const char kHomePage[] = "homepage";
34 34
35 // Set the time on the given SimpleTestClock to the given time in minutes. 35 // Set the time on the given SimpleTestClock to the given time in minutes.
36 void SetCurrentTimeInMinutes(double minutes, base::SimpleTestClock* clock) { 36 void SetCurrentTimeInMinutes(double minutes, base::SimpleTestClock* clock) {
37 const int32_t kBaseTimeMins = 100; 37 const int32_t kBaseTimeMins = 100;
38 clock->SetNow(base::Time::FromDoubleT((kBaseTimeMins + minutes) * 60)); 38 clock->SetNow(base::Time::FromDoubleT((kBaseTimeMins + minutes) * 60));
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 ASSERT_TRUE(file_writer->HasPendingWrite()); 949 ASSERT_TRUE(file_writer->HasPendingWrite());
950 950
951 // Call CommitPendingWrite and check that the lossy pref is there with the 951 // Call CommitPendingWrite and check that the lossy pref is there with the
952 // last value set above. 952 // last value set above.
953 pref_store->CommitPendingWrite(); 953 pref_store->CommitPendingWrite();
954 ASSERT_FALSE(file_writer->HasPendingWrite()); 954 ASSERT_FALSE(file_writer->HasPendingWrite());
955 ASSERT_EQ("{\"lossy\":\"lossy\"}", GetTestFileContents()); 955 ASSERT_EQ("{\"lossy\":\"lossy\"}", GetTestFileContents());
956 } 956 }
957 957
958 } // namespace base 958 } // namespace base
OLDNEW
« no previous file with comments | « base/prefs/default_pref_store_unittest.cc ('k') | base/prefs/mock_pref_change_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698