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

Unified Diff: chrome/browser/tab_contents/web_contents_unittest.cc

Issue 7892007: Add ChromeRenderViewHostTestHarness to get rid of the dependency from RVHTH to profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac Created 9 years, 3 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/browser/tab_contents/web_contents_unittest.cc
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index 613a18c934e734de6512feb41eea4b4043e6d1ca..d55bbe476c88594b17ed4a1814fd794408f3acc4 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -11,12 +11,12 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_pref_service.h"
#include "chrome/test/base/testing_profile.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
-#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance.h"
#include "content/browser/tab_contents/constrained_window.h"
#include "content/browser/tab_contents/navigation_details.h"
@@ -169,22 +169,19 @@ class TestInterstitialPageStateGuard : public TestInterstitialPage::Delegate {
TestInterstitialPage* interstitial_page_;
};
-class TabContentsTest : public RenderViewHostTestHarness {
+class TabContentsTest : public ChromeRenderViewHostTestHarness {
public:
- TabContentsTest()
- : RenderViewHostTestHarness(),
- ui_thread_(BrowserThread::UI, &message_loop_) {
+ TabContentsTest() : ui_thread_(BrowserThread::UI, &message_loop_) {
}
private:
// Supply our own profile so we use the correct profile data. The test harness
// is not supposed to overwrite a profile if it's already created.
virtual void SetUp() {
- TestingProfile* profile = new TestingProfile();
- profile_.reset(profile);
+ ChromeRenderViewHostTestHarness::SetUp();
// Set some (WebKit) user preferences.
- TestingPrefService* pref_services = profile->GetTestingPrefService();
+ TestingPrefService* pref_services = profile()->GetTestingPrefService();
#if defined(TOOLKIT_USES_GTK)
pref_services->SetUserPref(prefs::kUsesSystemTheme,
Value::CreateBooleanValue(false));
@@ -199,14 +196,6 @@ class TabContentsTest : public RenderViewHostTestHarness {
Value::CreateBooleanValue(true));
pref_services->SetUserPref("webkit.webprefs.foo",
Value::CreateStringValue("bar"));
-
- RenderViewHostTestHarness::SetUp();
- }
-
- virtual void TearDown() {
- RenderViewHostTestHarness::TearDown();
-
- profile_.reset(NULL);
}
BrowserThread ui_thread_;
« no previous file with comments | « chrome/browser/sessions/tab_restore_service_browsertest.cc ('k') | chrome/browser/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698