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

Unified Diff: content/public/test/test_renderer_host.h

Issue 18068017: Change RenderViewHostTestHarness to create BrowserContext after thread startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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: content/public/test/test_renderer_host.h
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index 7b0bfaefdf71e54f68ce6685ffab5c347cf71f97..cdb47407b5773fa4f77eb9acf60a6ff018fd9881 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -156,6 +156,12 @@ class RenderViewHostTestHarness : public testing::Test {
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
+ // Derived classes should override this method to use a custom BrowserContext.
+ // It is invoked by SetUp after threads were started.
+ // RenderViewHostTestHarness will take ownership of the returned
+ // BrowserContext.
+ virtual BrowserContext* CreateBrowserContext();
+
// Configures which TestBrowserThreads inside |thread_bundle| are backed by
// real threads. Must be called before SetUp().
void SetThreadBundleOptions(int options) {
@@ -172,13 +178,9 @@ class RenderViewHostTestHarness : public testing::Test {
// Replaces the RPH being used.
void SetRenderProcessHostFactory(RenderProcessHostFactory* factory);
- // This browser context will be created in SetUp if it has not already been
- // created. This allows tests to override the browser context if they so
- // choose in their own SetUp function before calling the base class's (us)
- // SetUp().
+ private:
scoped_ptr<BrowserContext> browser_context_;
- private:
// It is important not to use this directly in the implementation as
// web_contents() and SetContents() are virtual and may be
// overridden by subclasses.
« no previous file with comments | « content/browser/web_contents/web_contents_impl_unittest.cc ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698