Add a helper class for swizzling ObjC instance methods to TestWebKitAPI
Fixes <http://webkit.org/b/66565> TestWebKitAPI needs a way to override instance methods of NSScreen Reviewed by Anders Carlsson. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added new files. * TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Added. (-[SimpleObject setValue:]): Original implementation. (TestWebKitAPI::setValue2): (TestWebKitAPI::setValue3): Swizzled implementations. (TestWebKitAPI::TEST): Test that we can swizzle and re-swizzle and un-swizzle an ObjC instance method. * TestWebKitAPI/mac/InstanceMethodSwizzler.h: Added. * TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Added. (TestWebKitAPI::InstanceMethodSwizzler::InstanceMethodSwizzler): Swizzle the method. (TestWebKitAPI::InstanceMethodSwizzler::~InstanceMethodSwizzler): Unswizzle the method. git-svn-id: svn://svn.chromium.org/blink/trunk@93417 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment