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

Unified Diff: chrome/browser/browsing_data_remover_unittest.cc

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 years, 10 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/browsing_data_remover_unittest.cc
===================================================================
--- chrome/browser/browsing_data_remover_unittest.cc (revision 122721)
+++ chrome/browser/browsing_data_remover_unittest.cc (working copy)
@@ -292,6 +292,8 @@
db_thread_(BrowserThread::DB, &message_loop_),
webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_),
file_thread_(BrowserThread::FILE, &message_loop_),
+ file_user_blocking_thread_(
+ BrowserThread::FILE_USER_BLOCKING, &message_loop_),
io_thread_(BrowserThread::IO, &message_loop_),
profile_(new TestingProfile()) {
registrar_.Add(this, chrome::NOTIFICATION_BROWSING_DATA_REMOVED,
@@ -317,6 +319,7 @@
BrowsingDataRemover* remover = new BrowsingDataRemover(
profile_.get(), period,
base::Time::Now() + base::TimeDelta::FromMilliseconds(10));
+ remover->OverrideQuotaManagerForTesting(GetMockManager());
remover->AddObserver(tester);
called_with_details_.reset(new BrowsingDataRemover::NotificationDetails());
@@ -333,6 +336,7 @@
BrowsingDataRemover* remover = new BrowsingDataRemover(
profile_.get(), period,
base::Time::Now() + base::TimeDelta::FromMilliseconds(10));
+ remover->OverrideQuotaManagerForTesting(GetMockManager());
remover->AddObserver(tester);
called_with_details_.reset(new BrowsingDataRemover::NotificationDetails());
@@ -355,15 +359,15 @@
}
quota::MockQuotaManager* GetMockManager() {
- if (profile_->GetQuotaManager() == NULL) {
- profile_->SetQuotaManager(new quota::MockQuotaManager(
+ if (!quota_manager_) {
+ quota_manager_ = new quota::MockQuotaManager(
profile_->IsOffTheRecord(),
profile_->GetPath(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
- profile_->GetExtensionSpecialStoragePolicy()));
+ profile_->GetExtensionSpecialStoragePolicy());
}
- return (quota::MockQuotaManager*) profile_->GetQuotaManager();
+ return quota_manager_;
}
// content::NotificationObserver implementation.
@@ -392,8 +396,10 @@
content::TestBrowserThread db_thread_;
content::TestBrowserThread webkit_thread_;
content::TestBrowserThread file_thread_;
+ content::TestBrowserThread file_user_blocking_thread_;
content::TestBrowserThread io_thread_;
scoped_ptr<TestingProfile> profile_;
+ scoped_refptr<quota::MockQuotaManager> quota_manager_;
DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverTest);
};
« no previous file with comments | « chrome/browser/browsing_data_remover.cc ('k') | chrome/browser/chromeos/offline/offline_load_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698