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

Side by Side Diff: chrome/browser/chrome_browser_application_mac_unittest.mm

Issue 1233983004: Remove base/mac/scoped_nsexception_enabler.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "base/mac/scoped_nsexception_enabler.h"
8 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
9 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
10 #include "base/metrics/histogram_samples.h" 9 #include "base/metrics/histogram_samples.h"
11 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
12 #import "chrome/browser/chrome_browser_application_mac.h" 11 #import "chrome/browser/chrome_browser_application_mac.h"
13 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
14 13
15 using base::HistogramBase; 14 using base::HistogramBase;
16 using base::HistogramSamples; 15 using base::HistogramSamples;
17 using base::StatisticsRecorder; 16 using base::StatisticsRecorder;
18 17
19 namespace chrome_browser_application_mac { 18 namespace chrome_browser_application_mac {
20 19
21 // Generate an NSException with the given name. 20 // Generate an NSException with the given name.
22 NSException* ExceptionNamed(NSString* name) { 21 NSException* ExceptionNamed(NSString* name) {
23 base::mac::ScopedNSExceptionEnabler enabler;
24
25 return [NSException exceptionWithName:name 22 return [NSException exceptionWithName:name
26 reason:@"No reason given" 23 reason:@"No reason given"
27 userInfo:nil]; 24 userInfo:nil];
28 } 25 }
29 26
30 // Helper to keep binning expectations readible. 27 // Helper to keep binning expectations readible.
31 size_t BinForExceptionNamed(NSString* name) { 28 size_t BinForExceptionNamed(NSString* name) {
32 return BinForException(ExceptionNamed(name)); 29 return BinForException(ExceptionNamed(name));
33 } 30 }
34 31
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 EXPECT_EQ(2, samples->GetCount(3)); 82 EXPECT_EQ(2, samples->GetCount(3));
86 83
87 // The unknown exceptions should end up in the overflow bucket. 84 // The unknown exceptions should end up in the overflow bucket.
88 EXPECT_TRUE(histograms[0]->HasConstructionArguments(1, 85 EXPECT_TRUE(histograms[0]->HasConstructionArguments(1,
89 kUnknownNSException, 86 kUnknownNSException,
90 kUnknownNSException + 1)); 87 kUnknownNSException + 1));
91 EXPECT_EQ(4, samples->GetCount(kUnknownNSException)); 88 EXPECT_EQ(4, samples->GetCount(kUnknownNSException));
92 } 89 }
93 90
94 } // chrome_browser_application_mac 91 } // chrome_browser_application_mac
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698