Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/test/base/scoped_bundle_swizzler_mac.h

Issue 1211213003: mac: Swizzle out +[NSBundle mainBundle] for in process browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from rsesek. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698