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

Unified Diff: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc

Issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compile Created 8 years, 8 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/geolocation/chrome_geolocation_permission_context_unittest.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index 5ae6f87dca274f33d80015925cfb8261434c7c2f..7c461ac77bb00054f4cdad302c1f311442c0f7ce 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/hash_tables.h"
#include "base/memory/scoped_vector.h"
+#include "base/synchronization/waitable_event.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
@@ -141,6 +142,7 @@ class GeolocationPermissionContextTests : public TabContentsWrapperTestHarness {
virtual void TearDown() OVERRIDE;
content::TestBrowserThread ui_thread_;
+ content::TestBrowserThread db_thread_;
content::MockGeolocation mock_geolocation_;
// A map between renderer child id and a pair represending the bridge id and
@@ -150,7 +152,8 @@ class GeolocationPermissionContextTests : public TabContentsWrapperTestHarness {
GeolocationPermissionContextTests::GeolocationPermissionContextTests()
: TabContentsWrapperTestHarness(),
- ui_thread_(BrowserThread::UI, MessageLoop::current()) {
+ ui_thread_(BrowserThread::UI, MessageLoop::current()),
+ db_thread_(BrowserThread::DB) {
}
GeolocationPermissionContextTests::~GeolocationPermissionContextTests() {
@@ -230,6 +233,7 @@ void GeolocationPermissionContextTests::CheckTabContentsState(
}
void GeolocationPermissionContextTests::SetUp() {
+ db_thread_.Start();
TabContentsWrapperTestHarness::SetUp();
mock_geolocation_.Setup();
geolocation_permission_context_ =
@@ -240,6 +244,13 @@ void GeolocationPermissionContextTests::TearDown() {
extra_tabs_.reset();
mock_geolocation_.TearDown();
TabContentsWrapperTestHarness::TearDown();
+ // Schedule another task on the DB thread to notify us that it's safe to
+ // carry on with the test.
+ base::WaitableEvent done(false, false);
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
+ done.Wait();
+ db_thread_.Stop();
}
« no previous file with comments | « chrome/browser/extensions/app_notify_channel_setup_unittest.cc ('k') | chrome/browser/importer/profile_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698