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

Unified Diff: components/visitedlink/test/visitedlink_unittest.cc

Issue 12038055: Move visitedlink and auto_login_parser to component test target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« components/components_tests.gypi ('K') | « components/visitedlink/test/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/visitedlink/test/visitedlink_unittest.cc
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc
index ef1851fc1481218ef33f9a5e04085a4a29f7ba2e..f0e444438fd14746635b3eb1cfb950be52919770 100644
--- a/components/visitedlink/test/visitedlink_unittest.cc
+++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -13,8 +13,6 @@
#include "base/shared_memory.h"
#include "base/string_util.h"
#include "base/time.h"
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "chrome/test/base/testing_profile.h"
#include "components/visitedlink/browser/visitedlink_delegate.h"
#include "components/visitedlink/browser/visitedlink_event_listener.h"
#include "components/visitedlink/browser/visitedlink_master.h"
@@ -26,6 +24,7 @@
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_renderer_host.h"
+#include "content/public/test/test_renderer_host.h"
Jói 2013/01/24 11:01:55 delete this duplicate line
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -495,10 +494,9 @@ TEST_F(VisitedLinkTest, Listener) {
EXPECT_EQ(2, listener->reset_count());
}
-// TODO(boliu): Inherit content::TestBrowserContext when componentized.
-class VisitCountingProfile : public TestingProfile {
+class VisitCountingContext : public content::TestBrowserContext {
public:
- VisitCountingProfile()
+ VisitCountingContext()
: add_count_(0),
add_event_count_(0),
reset_event_count_(0),
@@ -552,8 +550,8 @@ class VisitRelayingRenderProcessHost : public MockRenderProcessHost {
virtual int VisibleWidgetCount() const OVERRIDE { return widgets_; }
virtual bool Send(IPC::Message* msg) OVERRIDE {
- VisitCountingProfile* counting_profile =
- static_cast<VisitCountingProfile*>(
+ VisitCountingContext* counting_profile =
+ static_cast<VisitCountingContext*>(
GetBrowserContext());
if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) {
@@ -592,23 +590,22 @@ class VisitedLinkRenderProcessHostFactory
DISALLOW_COPY_AND_ASSIGN(VisitedLinkRenderProcessHostFactory);
};
-// TODO(boliu): Inherit content::RenderViewHostTestHarness when componentized.
-class VisitedLinkEventsTest : public ChromeRenderViewHostTestHarness {
+class VisitedLinkEventsTest : public content::RenderViewHostTestHarness {
public:
VisitedLinkEventsTest()
: ui_thread_(BrowserThread::UI, &message_loop_),
file_thread_(BrowserThread::FILE, &message_loop_) {}
virtual ~VisitedLinkEventsTest() {}
virtual void SetUp() {
- browser_context_.reset(new VisitCountingProfile());
+ browser_context_.reset(new VisitCountingContext());
master_.reset(new VisitedLinkMaster(profile(), &delegate_));
master_->Init();
SetRenderProcessHostFactory(&vc_rph_factory_);
content::RenderViewHostTestHarness::SetUp();
}
- VisitCountingProfile* profile() const {
- return static_cast<VisitCountingProfile*>(browser_context_.get());
+ VisitCountingContext* profile() const {
+ return static_cast<VisitCountingContext*>(browser_context_.get());
}
VisitedLinkMaster* master() const {
@@ -763,7 +760,7 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
// Tests that VisitedLink ignores renderer process creation notification for a
// different profile.
TEST_F(VisitedLinkEventsTest, IgnoreRendererCreationFromDifferentContext) {
- VisitCountingProfile different_context;
+ VisitCountingContext different_context;
VisitRelayingRenderProcessHost different_process_host(&different_context);
content::NotificationService::current()->Notify(
« components/components_tests.gypi ('K') | « components/visitedlink/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698