OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_TEST_EVENT_UTILS_H_ |
| 6 #define CHROME_BROWSER_COCOA_TEST_EVENT_UTILS_H_ |
| 7 |
| 8 #import <objc/objc-class.h> |
| 9 |
| 10 #include "base/logging.h" |
| 11 |
| 12 // Within a given scope, replace the selector |selector| on |target| with that |
| 13 // from |source|. |
| 14 class ScopedClassSwizzler { |
| 15 public: |
| 16 ScopedClassSwizzler(Class target, Class source, SEL selector); |
| 17 ~ScopedClassSwizzler(); |
| 18 |
| 19 private: |
| 20 Method old_selector_impl_; |
| 21 Method new_selector_impl_; |
| 22 |
| 23 DISALLOW_COPY_AND_ASSIGN(ScopedClassSwizzler); |
| 24 }; |
| 25 |
| 26 namespace test_event_utils { |
| 27 |
| 28 // Create a synthetic mouse event for testing. Currently this is very basic, |
| 29 // flesh out as needed. |
| 30 NSEvent* MakeMouseEvent(NSEventType type, NSUInteger modifiers); |
| 31 |
| 32 } // namespace test_event_utils |
| 33 |
| 34 #endif // CHROME_BROWSER_COCOA_TEST_EVENT_UTILS_H_ |
| 35 |
OLD | NEW |