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

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

Issue 8498034: [Mac] Move event hooks from CrApplication to BrowserCrApplication. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: And copyright, sigh. Created 9 years, 1 month 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #import "base/mac/scoped_nsexception_enabler.h"
Robert Sesek 2011/11/10 20:59:47 nit: alphabetize
Scott Hess - ex-Googler 2011/11/10 21:06:51 I hate you. More precisely, I hate my aged eyes a
8 #import "chrome/browser/chrome_browser_application_mac.h" 9 #import "chrome/browser/chrome_browser_application_mac.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 using base::Histogram; 12 using base::Histogram;
12 using base::StatisticsRecorder; 13 using base::StatisticsRecorder;
13 14
14 namespace chrome_browser_application_mac { 15 namespace chrome_browser_application_mac {
15 16
16 // Generate an NSException with the given name. 17 // Generate an NSException with the given name.
17 NSException* ExceptionNamed(NSString* name) { 18 NSException* ExceptionNamed(NSString* name) {
19 base::mac::ScopedNSExceptionEnabler enabler;
20
18 return [NSException exceptionWithName:name 21 return [NSException exceptionWithName:name
19 reason:@"No reason given" 22 reason:@"No reason given"
20 userInfo:nil]; 23 userInfo:nil];
21 } 24 }
22 25
23 // Helper to keep binning expectations readible. 26 // Helper to keep binning expectations readible.
24 size_t BinForExceptionNamed(NSString* name) { 27 size_t BinForExceptionNamed(NSString* name) {
25 return BinForException(ExceptionNamed(name)); 28 return BinForException(ExceptionNamed(name));
26 } 29 }
27 30
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 EXPECT_EQ(1, sample.counts(1)); 78 EXPECT_EQ(1, sample.counts(1));
76 EXPECT_EQ(3, sample.counts(2)); 79 EXPECT_EQ(3, sample.counts(2));
77 EXPECT_EQ(2, sample.counts(3)); 80 EXPECT_EQ(2, sample.counts(3));
78 81
79 // The unknown exceptions should end up in the overflow bucket. 82 // The unknown exceptions should end up in the overflow bucket.
80 EXPECT_EQ(kUnknownNSException + 1, histograms[0]->bucket_count()); 83 EXPECT_EQ(kUnknownNSException + 1, histograms[0]->bucket_count());
81 EXPECT_EQ(4, sample.counts(kUnknownNSException)); 84 EXPECT_EQ(4, sample.counts(kUnknownNSException));
82 } 85 }
83 86
84 } // chrome_browser_application_mac 87 } // chrome_browser_application_mac
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_application_mac.mm ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698