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

Side by Side Diff: ios/chrome/test/app/histogram_test_util.mm

Issue 2888173002: [ObjC ARC] Converts ios/chrome/test/app:test_support to ARC. (Closed)
Patch Set: tighten deps exclusion Created 3 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 | « ios/chrome/test/app/chrome_test_util.mm ('k') | ios/chrome/test/app/history_test_util.mm » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "ios/chrome/test/app/histogram_test_util.h" 5 #import "ios/chrome/test/app/histogram_test_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
11 #include "base/metrics/histogram_samples.h" 11 #include "base/metrics/histogram_samples.h"
12 #include "base/metrics/metrics_hashes.h" 12 #include "base/metrics/metrics_hashes.h"
13 #include "base/metrics/sample_map.h" 13 #include "base/metrics/sample_map.h"
14 #include "base/metrics/statistics_recorder.h" 14 #include "base/metrics/statistics_recorder.h"
15 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 16
17 #if !defined(__has_feature) || !__has_feature(objc_arc)
18 #error "This file requires ARC support."
19 #endif
20
17 namespace { 21 namespace {
18 base::HistogramBase* FindHistogram(const std::string& name, 22 base::HistogramBase* FindHistogram(const std::string& name,
19 FailureBlock failure_block) { 23 FailureBlock failure_block) {
20 base::HistogramBase* histogram = 24 base::HistogramBase* histogram =
21 base::StatisticsRecorder::FindHistogram(name); 25 base::StatisticsRecorder::FindHistogram(name);
22 if (!histogram && failure_block) { 26 if (!histogram && failure_block) {
23 failure_block([NSString 27 failure_block([NSString
24 stringWithFormat:@"Histogram %s does not exist", name.c_str()]); 28 stringWithFormat:@"Histogram %s does not exist", name.c_str()]);
25 } 29 }
26 return histogram; 30 return histogram;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 failure_block( 182 failure_block(
179 [NSString stringWithFormat:@"Histogram \"%s\" doe not have the " 183 [NSString stringWithFormat:@"Histogram \"%s\" doe not have the "
180 "right total number of samples(%d). It has " 184 "right total number of samples(%d). It has "
181 "(%d).", 185 "(%d).",
182 name.c_str(), expected_count, actual_count]); 186 name.c_str(), expected_count, actual_count]);
183 } 187 }
184 return NO; 188 return NO;
185 } 189 }
186 190
187 } // namespace chrome_test_util 191 } // namespace chrome_test_util
OLDNEW
« no previous file with comments | « ios/chrome/test/app/chrome_test_util.mm ('k') | ios/chrome/test/app/history_test_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698