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 { | |
Robert Sesek
2015/06/26 22:36:54
How does this interact with the bundle faking out
erikchen
2015/06/26 23:14:53
Bundle faking works like this:
1) All Chrome code
Robert Sesek
2015/06/30 22:21:07
OK. Can you add some commentary as to when one wou
erikchen
2015/07/06 22:00:06
Done.
| |
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 |