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

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

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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.h » ('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 19 matching lines...) Expand all
30 30
31 // Wrapper to the test targets OnTaskSwitch() method. 31 // Wrapper to the test targets OnTaskSwitch() method.
32 void OnTaskSwitch(); 32 void OnTaskSwitch();
33 33
34 TaskSwitchTimeTracker* time_tracker() { 34 TaskSwitchTimeTracker* time_tracker() {
35 return time_tracker_test_api_->time_tracker(); 35 return time_tracker_test_api_->time_tracker();
36 } 36 }
37 37
38 protected: 38 protected:
39 // Used to verify recorded histogram data. 39 // Used to verify recorded histogram data.
40 scoped_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 scoped_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 } 50 }
51 51
52 TaskSwitchTimeTrackerTest::~TaskSwitchTimeTrackerTest() { 52 TaskSwitchTimeTrackerTest::~TaskSwitchTimeTrackerTest() {
53 } 53 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 histogram_tester_->ExpectTotalCount(kHistogramName, 1); 98 histogram_tester_->ExpectTotalCount(kHistogramName, 1);
99 histogram_tester_->ExpectBucketCount(kHistogramName, 0, 1); 99 histogram_tester_->ExpectBucketCount(kHistogramName, 0, 1);
100 100
101 time_tracker_test_api_->Advance(base::TimeDelta::FromSeconds(1)); 101 time_tracker_test_api_->Advance(base::TimeDelta::FromSeconds(1));
102 OnTaskSwitch(); 102 OnTaskSwitch();
103 histogram_tester_->ExpectTotalCount(kHistogramName, 2); 103 histogram_tester_->ExpectTotalCount(kHistogramName, 2);
104 histogram_tester_->ExpectBucketCount(kHistogramName, 1, 1); 104 histogram_tester_->ExpectBucketCount(kHistogramName, 1, 1);
105 } 105 }
106 106
107 } // namespace ash 107 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/task_switch_time_tracker.cc ('k') | ash/metrics/user_metrics_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698