• aroben@apple.com's avatar
    Add a helper class for swizzling ObjC instance methods to TestWebKitAPI · 707dcd04
    aroben@apple.com authored
    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
    707dcd04
ChangeLog 1.09 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.