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

Unified Diff: ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/test/task_switch_time_tracker_test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc
diff --git a/ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc b/ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc
index 010161805ad0ad2c5a6e68108e3b836e5ae6d353..1a21c56b340d83fd7c006c554b9cb08464be897a 100644
--- a/ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc
+++ b/ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc
@@ -118,13 +118,12 @@ void ShelfButtonPressedMetricTrackerTest::SetUp() {
ShelfButtonPressedMetricTrackerTestAPI test_api(metric_tracker_);
- scoped_ptr<base::TickClock> test_tick_clock(new base::SimpleTestTickClock());
- tick_clock_ = static_cast<base::SimpleTestTickClock*>(test_tick_clock.get());
- test_api.SetTickClock(std::move(test_tick_clock));
-
// Ensure the TickClock->NowTicks() doesn't return base::TimeTicks because
// ShelfButtonPressedMetricTracker interprets that value as unset.
- tick_clock_->Advance(base::TimeDelta::FromMilliseconds(100));
+ scoped_ptr<base::TickClock> test_tick_clock(new base::SimpleTestTickClock(
+ base::TimeTicks() + base::TimeDelta::FromMilliseconds(100)));
+ tick_clock_ = static_cast<base::SimpleTestTickClock*>(test_tick_clock.get());
+ test_api.SetTickClock(std::move(test_tick_clock));
}
void ShelfButtonPressedMetricTrackerTest::TearDown() {
« no previous file with comments | « no previous file | ash/test/task_switch_time_tracker_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698