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

Unified Diff: chrome/test/base/in_process_browser_test.cc

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: Minor formatting, nits. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/in_process_browser_test.cc
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index cb63fb1464cc312a393a082090aa012a62868974..ba8f460046ec968247bf17aacac2beb89801d219 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -54,6 +54,7 @@
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
+#include "chrome/test/base/scoped_bundle_swizzler_mac.h"
#endif
#if defined(OS_WIN)
@@ -230,6 +231,8 @@ void InProcessBrowserTest::SetUp() {
// anything sensitive gets stored, including Cookies). Without this,
// many tests will hang waiting for a user to approve KeyChain access.
OSCrypt::UseMockKeychain(true);
+
+ bundle_swizzler_.reset(new ScopedBundleSwizzlerMac);
#endif
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
@@ -374,6 +377,11 @@ void InProcessBrowserTest::TearDown() {
#if defined(OS_WIN)
com_initializer_.reset();
#endif
+
+#if defined(OS_MACOSX)
+ bundle_swizzler_.reset();
Robert Sesek 2015/06/26 22:36:54 Does this need to be done between each test, or ca
erikchen 2015/06/26 23:14:52 I'm generally prefer to keep all light-weight conf
+#endif
+
BrowserTestBase::TearDown();
}

Powered by Google App Engine
This is Rietveld 408576698