Changeset 93417 in webkit


Ignore:
Timestamp:
Aug 19, 2011 9:14:02 AM (13 years ago)
Author:
Adam Roben
Message:

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.

Location:
trunk/Tools
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r93416 r93417  
     12011-08-19  Adam Roben  <aroben@apple.com>
     2
     3        Add a helper class for swizzling ObjC instance methods to TestWebKitAPI
     4
     5        Fixes <http://webkit.org/b/66565> TestWebKitAPI needs a way to override instance methods of
     6        NSScreen
     7
     8        Reviewed by Anders Carlsson.
     9
     10        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added new files.
     11
     12        * TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Added.
     13        (-[SimpleObject setValue:]): Original implementation.
     14
     15        (TestWebKitAPI::setValue2):
     16        (TestWebKitAPI::setValue3):
     17        Swizzled implementations.
     18
     19        (TestWebKitAPI::TEST): Test that we can swizzle and re-swizzle and un-swizzle an ObjC
     20        instance method.
     21
     22        * TestWebKitAPI/mac/InstanceMethodSwizzler.h: Added.
     23        * TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Added.
     24        (TestWebKitAPI::InstanceMethodSwizzler::InstanceMethodSwizzler): Swizzle the method.
     25        (TestWebKitAPI::InstanceMethodSwizzler::~InstanceMethodSwizzler): Unswizzle the method.
     26
    1272011-08-19  Tom Zakrajsek  <tomz@codeaurora.org>
    228
Note: See TracChangeset for help on using the changeset viewer.