OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_ |
| 6 #define CHROME_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 |
| 11 namespace base { |
| 12 namespace mac { |
| 13 class ScopedObjCClassSwizzler; |
| 14 } // namespace mac |
| 15 } // namespace base |
| 16 |
| 17 // Within a given scope, swizzles the implementation of +[NSBundle mainBundle] |
| 18 // to return a partial mock of the original bundle. This partial mock has a |
| 19 // custom bundle identifier. |
| 20 // Since this class swizzles a class method, it doesn't make sense to have more |
| 21 // than one instance of this class in existence at the same time. |
| 22 class ScopedBundleSwizzlerMac { |
| 23 public: |
| 24 ScopedBundleSwizzlerMac(); |
| 25 ~ScopedBundleSwizzlerMac(); |
| 26 |
| 27 private: |
| 28 scoped_ptr<base::mac::ScopedObjCClassSwizzler> class_swizzler_; |
| 29 DISALLOW_COPY_AND_ASSIGN(ScopedBundleSwizzlerMac); |
| 30 }; |
| 31 |
| 32 #endif // CHROME_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_ |
OLD | NEW |