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

Side by Side Diff: ash/metrics/task_switch_time_tracker_unittest.cc

Issue 2095193002: clang-format all of //ash (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 | « ash/metrics/task_switch_time_tracker.cc ('k') | ash/metrics/user_metrics_recorder.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/metrics/task_switch_time_tracker.h" 5 #include "ash/metrics/task_switch_time_tracker.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/test/task_switch_time_tracker_test_api.h" 9 #include "ash/test/task_switch_time_tracker_test_api.h"
10 #include "base/test/histogram_tester.h" 10 #include "base/test/histogram_tester.h"
(...skipping 28 matching lines...) Expand all
39 // Used to verify recorded histogram data. 39 // Used to verify recorded histogram data.
40 std::unique_ptr<base::HistogramTester> histogram_tester_; 40 std::unique_ptr<base::HistogramTester> histogram_tester_;
41 41
42 // A Test API that wraps the test target. 42 // A Test API that wraps the test target.
43 std::unique_ptr<test::TaskSwitchTimeTrackerTestAPI> time_tracker_test_api_; 43 std::unique_ptr<test::TaskSwitchTimeTrackerTestAPI> time_tracker_test_api_;
44 44
45 private: 45 private:
46 DISALLOW_COPY_AND_ASSIGN(TaskSwitchTimeTrackerTest); 46 DISALLOW_COPY_AND_ASSIGN(TaskSwitchTimeTrackerTest);
47 }; 47 };
48 48
49 TaskSwitchTimeTrackerTest::TaskSwitchTimeTrackerTest() { 49 TaskSwitchTimeTrackerTest::TaskSwitchTimeTrackerTest() {}
50 }
51 50
52 TaskSwitchTimeTrackerTest::~TaskSwitchTimeTrackerTest() { 51 TaskSwitchTimeTrackerTest::~TaskSwitchTimeTrackerTest() {}
53 }
54 52
55 void TaskSwitchTimeTrackerTest::SetUp() { 53 void TaskSwitchTimeTrackerTest::SetUp() {
56 testing::Test::SetUp(); 54 testing::Test::SetUp();
57 55
58 histogram_tester_.reset(new base::HistogramTester()); 56 histogram_tester_.reset(new base::HistogramTester());
59 time_tracker_test_api_.reset( 57 time_tracker_test_api_.reset(
60 new test::TaskSwitchTimeTrackerTestAPI(kHistogramName)); 58 new test::TaskSwitchTimeTrackerTestAPI(kHistogramName));
61 // The TaskSwitchTimeTracker interprets a value of base::TimeTicks() as if the 59 // The TaskSwitchTimeTracker interprets a value of base::TimeTicks() as if the
62 // |last_action_time_| has not been set. 60 // |last_action_time_| has not been set.
63 time_tracker_test_api_->Advance(base::TimeDelta::FromMilliseconds(1)); 61 time_tracker_test_api_->Advance(base::TimeDelta::FromMilliseconds(1));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 histogram_tester_->ExpectTotalCount(kHistogramName, 1); 96 histogram_tester_->ExpectTotalCount(kHistogramName, 1);
99 histogram_tester_->ExpectBucketCount(kHistogramName, 0, 1); 97 histogram_tester_->ExpectBucketCount(kHistogramName, 0, 1);
100 98
101 time_tracker_test_api_->Advance(base::TimeDelta::FromSeconds(1)); 99 time_tracker_test_api_->Advance(base::TimeDelta::FromSeconds(1));
102 OnTaskSwitch(); 100 OnTaskSwitch();
103 histogram_tester_->ExpectTotalCount(kHistogramName, 2); 101 histogram_tester_->ExpectTotalCount(kHistogramName, 2);
104 histogram_tester_->ExpectBucketCount(kHistogramName, 1, 1); 102 histogram_tester_->ExpectBucketCount(kHistogramName, 1, 1);
105 } 103 }
106 104
107 } // namespace ash 105 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/task_switch_time_tracker.cc ('k') | ash/metrics/user_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698