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

Unified Diff: ui/events/cocoa/events_mac_unittest.mm

Issue 345243007: Add ScopedObjCClassSwizzler in base/mac, absorbs objc_method_swizzle and ScopedClassSwizzler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Inlude in shiny new gn base_unittests target Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils_unittest.mm ('k') | ui/events/test/cocoa_test_event_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/events_mac_unittest.mm
diff --git a/ui/events/cocoa/events_mac_unittest.mm b/ui/events/cocoa/events_mac_unittest.mm
index 77f85495f481a8b32842a5acb0d13d4a94e4eeab..f58cfd04da0a4190c53896be4fc9615f31de29dd 100644
--- a/ui/events/cocoa/events_mac_unittest.mm
+++ b/ui/events/cocoa/events_mac_unittest.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_cftyperef.h"
+#import "base/mac/scoped_objc_class_swizzler.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event_constants.h"
@@ -32,7 +33,7 @@ NSWindow* g_test_window = nil;
@end
@implementation MiddleMouseButtonNumberDonor
-- (NSUInteger)buttonNumber { return 2; }
+- (NSInteger)buttonNumber { return 2; }
@end
@implementation TestWindowDonor
@@ -57,7 +58,7 @@ class EventsMacTest : public CocoaTest {
void SwizzleMiddleMouseButton() {
DCHECK(!swizzler_);
- swizzler_.reset(new ScopedClassSwizzler(
+ swizzler_.reset(new base::mac::ScopedObjCClassSwizzler(
[NSEvent class],
[MiddleMouseButtonNumberDonor class],
@selector(buttonNumber)));
@@ -67,10 +68,8 @@ class EventsMacTest : public CocoaTest {
DCHECK(!g_test_window);
DCHECK(!swizzler_);
g_test_window = test_window();
- swizzler_.reset(new ScopedClassSwizzler(
- [NSEvent class],
- [TestWindowDonor class],
- @selector(window)));
+ swizzler_.reset(new base::mac::ScopedObjCClassSwizzler(
+ [NSEvent class], [TestWindowDonor class], @selector(window)));
}
void ClearSwizzle() {
@@ -117,7 +116,7 @@ class EventsMacTest : public CocoaTest {
}
private:
- scoped_ptr<ScopedClassSwizzler> swizzler_;
+ scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_;
DISALLOW_COPY_AND_ASSIGN(EventsMacTest);
};
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils_unittest.mm ('k') | ui/events/test/cocoa_test_event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698