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

Side by Side Diff: base/test/test_reg_util_win_unittest.cc

Issue 2086393003: Make callers of FromUTC(Local)Exploded in base/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « base/metrics/field_trial.cc ('k') | base/time/time_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/test_reg_util_win.h" 5 #include "base/test/test_reg_util_win.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 EXPECT_EQ(42u, value); 94 EXPECT_EQ(42u, value);
95 read_key.Close(); 95 read_key.Close();
96 96
97 manager_.reset(); 97 manager_.reset();
98 98
99 AssertKeyAbsent(kTestKeyPath); 99 AssertKeyAbsent(kTestKeyPath);
100 } 100 }
101 101
102 TEST_F(RegistryOverrideManagerTest, DeleteStaleKeys) { 102 TEST_F(RegistryOverrideManagerTest, DeleteStaleKeys) {
103 base::Time::Exploded kTestTimeExploded = {2013, 11, 1, 4, 0, 0, 0, 0}; 103 base::Time::Exploded kTestTimeExploded = {2013, 11, 1, 4, 0, 0, 0, 0};
104 base::Time kTestTime = base::Time::FromUTCExploded(kTestTimeExploded); 104 base::Time kTestTime;
105 EXPECT_TRUE(base::Time::FromUTCExploded(kTestTimeExploded, &kTestTime));
105 106
106 base::string16 path_garbage = fake_test_key_root_ + L"\\Blah"; 107 base::string16 path_garbage = fake_test_key_root_ + L"\\Blah";
107 base::string16 path_very_stale = 108 base::string16 path_very_stale =
108 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(100)); 109 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(100));
109 base::string16 path_stale = 110 base::string16 path_stale =
110 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(5)); 111 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(5));
111 base::string16 path_current = 112 base::string16 path_current =
112 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromMinutes(1)); 113 FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromMinutes(1));
113 base::string16 path_future = 114 base::string16 path_future =
114 FakeOverrideManagerPath(kTestTime + base::TimeDelta::FromMinutes(1)); 115 FakeOverrideManagerPath(kTestTime + base::TimeDelta::FromMinutes(1));
115 116
116 CreateKey(path_garbage); 117 CreateKey(path_garbage);
117 CreateKey(path_very_stale); 118 CreateKey(path_very_stale);
118 CreateKey(path_stale); 119 CreateKey(path_stale);
119 CreateKey(path_current); 120 CreateKey(path_current);
120 CreateKey(path_future); 121 CreateKey(path_future);
121 122
122 CreateManager(kTestTime); 123 CreateManager(kTestTime);
123 manager_.reset(); 124 manager_.reset();
124 125
125 AssertKeyAbsent(path_garbage); 126 AssertKeyAbsent(path_garbage);
126 AssertKeyAbsent(path_very_stale); 127 AssertKeyAbsent(path_very_stale);
127 AssertKeyAbsent(path_stale); 128 AssertKeyAbsent(path_stale);
128 AssertKeyExists(path_current); 129 AssertKeyExists(path_current);
129 AssertKeyExists(path_future); 130 AssertKeyExists(path_future);
130 } 131 }
131 132
132 } // namespace registry_util 133 } // namespace registry_util
OLDNEW
« no previous file with comments | « base/metrics/field_trial.cc ('k') | base/time/time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698