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

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

Issue 14197014: Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 7 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
« no previous file with comments | « content/public/test/test_browser_thread_bundle.cc ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 44b5ff86e41d9c6dff44b9843273fbdfa45b62c3..7b0bfaefdf71e54f68ce6685ffab5c347cf71f97 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/page_transition_types.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(USE_AURA)
@@ -155,6 +156,15 @@ class RenderViewHostTestHarness : public testing::Test {
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
+ // Configures which TestBrowserThreads inside |thread_bundle| are backed by
+ // real threads. Must be called before SetUp().
+ void SetThreadBundleOptions(int options) {
+ DCHECK(thread_bundle_.get() == NULL);
+ thread_bundle_options_ = options;
+ }
+
+ TestBrowserThreadBundle* thread_bundle() { return thread_bundle_.get(); }
+
#if defined(USE_AURA)
aura::RootWindow* root_window() { return aura_test_helper_->root_window(); }
#endif
@@ -168,8 +178,6 @@ class RenderViewHostTestHarness : public testing::Test {
// SetUp().
scoped_ptr<BrowserContext> browser_context_;
- base::MessageLoopForUI message_loop_;
-
private:
// It is important not to use this directly in the implementation as
// web_contents() and SetContents() are virtual and may be
@@ -183,6 +191,9 @@ class RenderViewHostTestHarness : public testing::Test {
#endif
RenderViewHostTestEnabler rvh_test_enabler_;
+ int thread_bundle_options_;
+ scoped_ptr<TestBrowserThreadBundle> thread_bundle_;
+
DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness);
};
« no previous file with comments | « content/public/test/test_browser_thread_bundle.cc ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698