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

Unified Diff: chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm

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/ui/cocoa/notifications/balloon_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
index a58c9be1dcd868a42c8e89b3a2775c7c9130388a..cb40b3b727766ec7b20d2b90d04cf74745afccb1 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
@@ -10,8 +10,8 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#include "chrome/browser/ui/cocoa/notifications/balloon_controller.h"
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/test_render_view_host.h"
// Subclass balloon controller and mock out the initialization of the RVH.
@interface TestBalloonController : BalloonController {
@@ -45,7 +45,7 @@ class MockBalloonCollection : public BalloonCollection {
Balloons balloons_;
};
-class BalloonControllerTest : public RenderViewHostTestHarness {
+class BalloonControllerTest : public ChromeRenderViewHostTestHarness {
public:
BalloonControllerTest() :
ui_thread_(BrowserThread::UI, MessageLoop::current()),
@@ -53,23 +53,23 @@ class BalloonControllerTest : public RenderViewHostTestHarness {
}
virtual void SetUp() {
- RenderViewHostTestHarness::SetUp();
+ ChromeRenderViewHostTestHarness::SetUp();
CocoaTest::BootstrapCocoa();
- profile_.reset(new TestingProfile());
- profile_->CreateRequestContext();
- browser_.reset(new Browser(Browser::TYPE_TABBED, profile_.get()));
+ profile()->CreateRequestContext();
+ browser_.reset(new Browser(Browser::TYPE_TABBED, profile()));
collection_.reset(new MockBalloonCollection());
}
virtual void TearDown() {
+ collection_.reset();
+ browser_.reset();
MessageLoop::current()->RunAllPending();
- RenderViewHostTestHarness::TearDown();
+ ChromeRenderViewHostTestHarness::TearDown();
}
protected:
BrowserThread ui_thread_;
BrowserThread io_thread_;
- scoped_ptr<TestingProfile> profile_;
scoped_ptr<Browser> browser_;
scoped_ptr<BalloonCollection> collection_;
};
@@ -79,7 +79,7 @@ TEST_F(BalloonControllerTest, ShowAndCloseTest) {
ASCIIToUTF16("http://www.google.com"), string16(),
new NotificationObjectProxy(-1, -1, -1, false));
scoped_ptr<Balloon> balloon(
- new Balloon(n, profile_.get(), collection_.get()));
+ new Balloon(n, profile(), collection_.get()));
balloon->SetPosition(gfx::Point(1, 1), false);
balloon->set_content_size(gfx::Size(100, 100));
@@ -95,7 +95,7 @@ TEST_F(BalloonControllerTest, SizesTest) {
ASCIIToUTF16("http://www.google.com"), string16(),
new NotificationObjectProxy(-1, -1, -1, false));
scoped_ptr<Balloon> balloon(
- new Balloon(n, profile_.get(), collection_.get()));
+ new Balloon(n, profile(), collection_.get()));
balloon->SetPosition(gfx::Point(1, 1), false);
balloon->set_content_size(gfx::Size(100, 100));

Powered by Google App Engine
This is Rietveld 408576698