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

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

Issue 10185008: Taking over issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
===================================================================
--- chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (revision 136877)
+++ chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (working copy)
@@ -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"
@@ -140,6 +141,7 @@
virtual void TearDown() OVERRIDE;
content::TestBrowserThread ui_thread_;
+ content::TestBrowserThread db_thread_;
// A map between renderer child id and a pair represending the bridge id and
// whether the requested permission was allowed.
@@ -148,7 +150,8 @@
GeolocationPermissionContextTests::GeolocationPermissionContextTests()
: TabContentsWrapperTestHarness(),
- ui_thread_(BrowserThread::UI, MessageLoop::current()) {
+ ui_thread_(BrowserThread::UI, MessageLoop::current()),
+ db_thread_(BrowserThread::DB) {
}
GeolocationPermissionContextTests::~GeolocationPermissionContextTests() {
@@ -228,6 +231,7 @@
}
void GeolocationPermissionContextTests::SetUp() {
+ db_thread_.Start();
TabContentsWrapperTestHarness::SetUp();
geolocation_permission_context_ =
new ChromeGeolocationPermissionContext(profile());
@@ -236,6 +240,13 @@
void GeolocationPermissionContextTests::TearDown() {
extra_tabs_.reset();
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