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

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

Issue 804533005: Standardize usage of virtual/override/final specifiers in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years 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
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/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate { 80 class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate {
81 public: 81 public:
82 MOCK_METHOD1(OnError, void(PersistentPrefStore::PrefReadError)); 82 MOCK_METHOD1(OnError, void(PersistentPrefStore::PrefReadError));
83 }; 83 };
84 84
85 } // namespace 85 } // namespace
86 86
87 class JsonPrefStoreTest : public testing::Test { 87 class JsonPrefStoreTest : public testing::Test {
88 protected: 88 protected:
89 virtual void SetUp() override { 89 void SetUp() override {
90 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 90 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
91 91
92 ASSERT_TRUE(PathService::Get(base::DIR_TEST_DATA, &data_dir_)); 92 ASSERT_TRUE(PathService::Get(base::DIR_TEST_DATA, &data_dir_));
93 data_dir_ = data_dir_.AppendASCII("prefs"); 93 data_dir_ = data_dir_.AppendASCII("prefs");
94 ASSERT_TRUE(PathExists(data_dir_)); 94 ASSERT_TRUE(PathExists(data_dir_));
95 } 95 }
96 96
97 virtual void TearDown() override { 97 void TearDown() override {
98 // Make sure all pending tasks have been processed (e.g., deleting the 98 // Make sure all pending tasks have been processed (e.g., deleting the
99 // JsonPrefStore may post write tasks). 99 // JsonPrefStore may post write tasks).
100 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure()); 100 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
101 message_loop_.Run(); 101 message_loop_.Run();
102 } 102 }
103 103
104 // The path to temporary directory used to contain the test operations. 104 // The path to temporary directory used to contain the test operations.
105 base::ScopedTempDir temp_dir_; 105 base::ScopedTempDir temp_dir_;
106 // The path to the directory where the test data is stored. 106 // The path to the directory where the test data is stored.
107 base::FilePath data_dir_; 107 base::FilePath data_dir_;
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 // "new_windows_in_tabs": true, 665 // "new_windows_in_tabs": true,
666 // "max_tabs": 20 666 // "max_tabs": 20
667 // } 667 // }
668 // } 668 // }
669 669
670 RunBasicJsonPrefStoreTest( 670 RunBasicJsonPrefStoreTest(
671 pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json")); 671 pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json"));
672 } 672 }
673 673
674 } // namespace base 674 } // namespace base
OLDNEW
« no previous file with comments | « base/power_monitor/power_monitor_unittest.cc ('k') | base/prefs/overlay_user_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698