Disallow use of content::TestBrowserContext from //chrome/browser.
Remove the single such use that I found.
Full rationale in chromium-dev thread at http://goo.gl/QQG5wo. Short
story is that this can lead to an invalid cast (to Profile) in some of
the commonly-used test harnesses under //chrome/browser, and within
//chrome/browser a TestingProfile should be used instead.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/22872009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218006 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 6b18145..6e3345c 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -50,6 +50,9 @@
"+win8/viewer",
"+xib_localizers", # For generated mac localization helpers
+ # Unsafe to use from //chrome, see http://goo.gl/QQG5wo
+ "-content/public/test/test_browser_context.h",
+
# TODO(stuartmorgan): Remove these by refactoring necessary code out of
# webkit/. See crbug.com/146251
# DO NOT ADD ANY MORE ITEMS TO THE LIST BELOW!
diff --git a/chrome/browser/extensions/event_listener_map_unittest.cc b/chrome/browser/extensions/event_listener_map_unittest.cc
index d1b657f..1b2959c2 100644
--- a/chrome/browser/extensions/event_listener_map_unittest.cc
+++ b/chrome/browser/extensions/event_listener_map_unittest.cc
@@ -6,8 +6,8 @@
#include "chrome/browser/extensions/event_listener_map.h"
#include "chrome/browser/extensions/event_router.h"
+#include "chrome/test/base/testing_profile.h"
#include "content/public/test/mock_render_process_host.h"
-#include "content/public/test/test_browser_context.h"
using base::DictionaryValue;
using base::ListValue;
@@ -32,8 +32,8 @@
EventListenerMapUnittest()
: delegate_(new EmptyDelegate),
listeners_(new EventListenerMap(delegate_.get())),
- browser_context_(new content::TestBrowserContext),
- process_(new content::MockRenderProcessHost(browser_context_.get())) {
+ profile_(new TestingProfile),
+ process_(new content::MockRenderProcessHost(profile_.get())) {
}
scoped_ptr<DictionaryValue> CreateHostSuffixFilter(
@@ -66,7 +66,7 @@
protected:
scoped_ptr<EventListenerMap::Delegate> delegate_;
scoped_ptr<EventListenerMap> listeners_;
- scoped_ptr<content::TestBrowserContext> browser_context_;
+ scoped_ptr<TestingProfile> profile_;
scoped_ptr<content::MockRenderProcessHost> process_;
};