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

Side by Side Diff: base/metrics/statistics_recorder_unittest.cc

Issue 804533005: Standardize usage of virtual/override/final specifiers in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 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 unified diff | Download patch
« no previous file with comments | « base/metrics/sparse_histogram_unittest.cc ('k') | base/power_monitor/power_monitor_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 class StatisticsRecorderTest : public testing::Test { 16 class StatisticsRecorderTest : public testing::Test {
17 protected: 17 protected:
18 virtual void SetUp() { 18 void SetUp() override {
19 // Each test will have a clean state (no Histogram / BucketRanges 19 // Each test will have a clean state (no Histogram / BucketRanges
20 // registered). 20 // registered).
21 InitializeStatisticsRecorder(); 21 InitializeStatisticsRecorder();
22 } 22 }
23 23
24 virtual void TearDown() { 24 void TearDown() override { UninitializeStatisticsRecorder(); }
25 UninitializeStatisticsRecorder();
26 }
27 25
28 void InitializeStatisticsRecorder() { 26 void InitializeStatisticsRecorder() {
29 statistics_recorder_ = new StatisticsRecorder(); 27 statistics_recorder_ = new StatisticsRecorder();
30 } 28 }
31 29
32 void UninitializeStatisticsRecorder() { 30 void UninitializeStatisticsRecorder() {
33 delete statistics_recorder_; 31 delete statistics_recorder_;
34 statistics_recorder_ = NULL; 32 statistics_recorder_ = NULL;
35 } 33 }
36 34
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 306
309 json.clear(); 307 json.clear();
310 UninitializeStatisticsRecorder(); 308 UninitializeStatisticsRecorder();
311 309
312 // No data should be returned. 310 // No data should be returned.
313 json = StatisticsRecorder::ToJSON(query); 311 json = StatisticsRecorder::ToJSON(query);
314 EXPECT_TRUE(json.empty()); 312 EXPECT_TRUE(json.empty());
315 } 313 }
316 314
317 } // namespace base 315 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/sparse_histogram_unittest.cc ('k') | base/power_monitor/power_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698