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

Side by Side Diff: chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_util_unittest.cc

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "chrome/browser/performance_monitor/metric.h" 9 #include "chrome/browser/performance_monitor/metric.h"
10 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti l.h" 10 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti l.h"
(...skipping 24 matching lines...) Expand all
35 aggregator.reset(new NoAggregation()); 35 aggregator.reset(new NoAggregation());
36 break; 36 break;
37 case AGGREGATION_METHOD_MEDIAN: 37 case AGGREGATION_METHOD_MEDIAN:
38 aggregator.reset(new MedianAggregation()); 38 aggregator.reset(new MedianAggregation());
39 break; 39 break;
40 case AGGREGATION_METHOD_MEAN: 40 case AGGREGATION_METHOD_MEAN:
41 aggregator.reset(new MeanAggregation()); 41 aggregator.reset(new MeanAggregation());
42 break; 42 break;
43 default: 43 default:
44 NOTREACHED(); 44 NOTREACHED();
45 return scoped_ptr<Database::MetricVector>(NULL); 45 return scoped_ptr<Database::MetricVector>();
46 } 46 }
47 return aggregator->AggregateInterval( 47 return aggregator->AggregateInterval(
48 type, &metric, metrics->end(), start, kMaxTime, resolution); 48 type, &metric, metrics->end(), start, kMaxTime, resolution);
49 } 49 }
50 }; 50 };
51 51
52 TEST_F(PerformanceMonitorUtilTest, AggregateMetricEmptyTest) { 52 TEST_F(PerformanceMonitorUtilTest, AggregateMetricEmptyTest) {
53 Database::MetricVector metric_vector; 53 Database::MetricVector metric_vector;
54 const base::Time data_time = base::Time::FromDoubleT(1); 54 const base::Time data_time = base::Time::FromDoubleT(1);
55 metric_vector.push_back(Metric(METRIC_CPU_USAGE, data_time, 1)); 55 metric_vector.push_back(Metric(METRIC_CPU_USAGE, data_time, 1));
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 expected = 12; 243 expected = 12;
244 for (Database::MetricVector::const_iterator iter = metric_series.begin(); 244 for (Database::MetricVector::const_iterator iter = metric_series.begin();
245 iter != metric_series.end(); ++iter) { 245 iter != metric_series.end(); ++iter) {
246 EXPECT_EQ(expected, iter->value); 246 EXPECT_EQ(expected, iter->value);
247 EXPECT_EQ(base::Time::FromDoubleT(expected), iter->time); 247 EXPECT_EQ(base::Time::FromDoubleT(expected), iter->time);
248 ++expected; 248 ++expected;
249 } 249 }
250 } 250 }
251 251
252 } // namespace performance_monitor 252 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698