Commit fe306d38 authored by avi@chromium.org's avatar avi@chromium.org

Remove TabContents from geolocation.

BUG=107201
TEST=no visible change


Review URL: https://chromiumcodereview.appspot.com/11189026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162408 0039d316-1c4b-4281-b951-d872f2087c98
parent 1bf48993
...@@ -16,10 +16,9 @@ ...@@ -16,10 +16,9 @@
#include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
#include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_tab_helper.h" #include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/tab_contents/test_tab_contents.h"
#include "chrome/browser/view_type_utils.h" #include "chrome/browser/view_type_utils.h"
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
...@@ -96,7 +95,8 @@ void ClosedDelegateTracker::Clear() { ...@@ -96,7 +95,8 @@ void ClosedDelegateTracker::Clear() {
// GeolocationPermissionContextTests ------------------------------------------ // GeolocationPermissionContextTests ------------------------------------------
// This class sets up GeolocationArbitrator. // This class sets up GeolocationArbitrator.
class GeolocationPermissionContextTests : public TabContentsTestHarness { class GeolocationPermissionContextTests
: public ChromeRenderViewHostTestHarness {
public: public:
GeolocationPermissionContextTests(); GeolocationPermissionContextTests();
...@@ -144,7 +144,7 @@ class GeolocationPermissionContextTests : public TabContentsTestHarness { ...@@ -144,7 +144,7 @@ class GeolocationPermissionContextTests : public TabContentsTestHarness {
ScopedVector<WebContents> extra_tabs_; ScopedVector<WebContents> extra_tabs_;
private: private:
// TabContentsTestHarness: // ChromeRenderViewHostTestHarness:
virtual void SetUp() OVERRIDE; virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE; virtual void TearDown() OVERRIDE;
...@@ -157,7 +157,7 @@ class GeolocationPermissionContextTests : public TabContentsTestHarness { ...@@ -157,7 +157,7 @@ class GeolocationPermissionContextTests : public TabContentsTestHarness {
}; };
GeolocationPermissionContextTests::GeolocationPermissionContextTests() GeolocationPermissionContextTests::GeolocationPermissionContextTests()
: TabContentsTestHarness(), : ChromeRenderViewHostTestHarness(),
ui_thread_(BrowserThread::UI, MessageLoop::current()), ui_thread_(BrowserThread::UI, MessageLoop::current()),
db_thread_(BrowserThread::DB) { db_thread_(BrowserThread::DB) {
} }
...@@ -245,14 +245,20 @@ void GeolocationPermissionContextTests::CheckTabContentsState( ...@@ -245,14 +245,20 @@ void GeolocationPermissionContextTests::CheckTabContentsState(
void GeolocationPermissionContextTests::SetUp() { void GeolocationPermissionContextTests::SetUp() {
db_thread_.Start(); db_thread_.Start();
TabContentsTestHarness::SetUp(); ChromeRenderViewHostTestHarness::SetUp();
// Set up required helpers, and make this be as "tabby" as the code requires.
chrome::SetViewType(web_contents(), chrome::VIEW_TYPE_TAB_CONTENTS);
InfoBarTabHelper::CreateForWebContents(web_contents());
TabSpecificContentSettings::CreateForWebContents(web_contents());
geolocation_permission_context_ = geolocation_permission_context_ =
new ChromeGeolocationPermissionContext(profile()); new ChromeGeolocationPermissionContext(profile());
} }
void GeolocationPermissionContextTests::TearDown() { void GeolocationPermissionContextTests::TearDown() {
extra_tabs_.clear(); extra_tabs_.clear();
TabContentsTestHarness::TearDown(); ChromeRenderViewHostTestHarness::TearDown();
// Schedule another task on the DB thread to notify us that it's safe to // Schedule another task on the DB thread to notify us that it's safe to
// carry on with the test. // carry on with the test.
base::WaitableEvent done(false, false); base::WaitableEvent done(false, false);
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
#include "chrome/browser/ui/tab_contents/test_tab_contents.h" #include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h" #include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_thread.h" #include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
class GeolocationInfoBarQueueControllerTests : public TabContentsTestHarness { class GeolocationInfoBarQueueControllerTests
: public ChromeRenderViewHostTestHarness {
public: public:
GeolocationInfoBarQueueControllerTests(); GeolocationInfoBarQueueControllerTests();
...@@ -20,6 +22,9 @@ class GeolocationInfoBarQueueControllerTests : public TabContentsTestHarness { ...@@ -20,6 +22,9 @@ class GeolocationInfoBarQueueControllerTests : public TabContentsTestHarness {
int RenderId(); int RenderId();
private: private:
// ChromeRenderViewHostTestHarness:
virtual void SetUp() OVERRIDE;
content::TestBrowserThread ui_thread_; content::TestBrowserThread ui_thread_;
DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueControllerTests); DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueControllerTests);
...@@ -37,6 +42,11 @@ int GeolocationInfoBarQueueControllerTests::RenderId() { ...@@ -37,6 +42,11 @@ int GeolocationInfoBarQueueControllerTests::RenderId() {
return contents()->GetRenderViewHost()->GetRoutingID(); return contents()->GetRenderViewHost()->GetRoutingID();
} }
void GeolocationInfoBarQueueControllerTests::SetUp() {
ChromeRenderViewHostTestHarness::SetUp();
InfoBarTabHelper::CreateForWebContents(web_contents());
}
class ObservationCountingQueueController : class ObservationCountingQueueController :
public GeolocationInfoBarQueueController { public GeolocationInfoBarQueueController {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment