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

Side by Side Diff: components/metrics/daily_event_unittest.cc

Issue 1662843002: Revert of Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « components/metrics/daily_event.cc ('k') | components/metrics/metrics_log.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/metrics/daily_event.h" 5 #include "components/metrics/daily_event.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "components/prefs/testing_pref_service.h" 8 #include "base/prefs/testing_pref_service.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace metrics { 11 namespace metrics {
12 12
13 namespace { 13 namespace {
14 14
15 const char kTestPrefName[] = "TestPref"; 15 const char kTestPrefName[] = "TestPref";
16 const char kTestMetricName[] = "TestMetric"; 16 const char kTestMetricName[] = "TestMetric";
17 17
18 class TestDailyObserver : public DailyEvent::Observer { 18 class TestDailyObserver : public DailyEvent::Observer {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 // The event should not fire if the preference is less than a day in the future. 86 // The event should not fire if the preference is less than a day in the future.
87 TEST_F(DailyEventTest, TestSoonNotFired) { 87 TEST_F(DailyEventTest, TestSoonNotFired) {
88 base::Time last_time = base::Time::Now() + base::TimeDelta::FromMinutes(2); 88 base::Time last_time = base::Time::Now() + base::TimeDelta::FromMinutes(2);
89 prefs_.SetInt64(kTestPrefName, last_time.ToInternalValue()); 89 prefs_.SetInt64(kTestPrefName, last_time.ToInternalValue());
90 event_.CheckInterval(); 90 event_.CheckInterval();
91 EXPECT_FALSE(observer_->fired()); 91 EXPECT_FALSE(observer_->fired());
92 } 92 }
93 93
94 } // namespace metrics 94 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/daily_event.cc ('k') | components/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698