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

Unified Diff: content/test/test_browser_thread.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
« no previous file with comments | « content/test/test_browser_context.cc ('k') | webkit/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_browser_thread.cc
===================================================================
--- content/test/test_browser_thread.cc (revision 122721)
+++ content/test/test_browser_thread.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "base/threading/thread.h"
#include "content/browser/browser_thread_impl.h"
+#include "content/browser/notification_service_impl.h"
namespace content {
@@ -14,12 +15,14 @@
class TestBrowserThreadImpl : public BrowserThreadImpl {
public:
explicit TestBrowserThreadImpl(BrowserThread::ID identifier)
- : BrowserThreadImpl(identifier) {
+ : BrowserThreadImpl(identifier),
+ notification_service_(NULL) {
}
TestBrowserThreadImpl(BrowserThread::ID identifier,
MessageLoop* message_loop)
- : BrowserThreadImpl(identifier, message_loop) {
+ : BrowserThreadImpl(identifier, message_loop),
+ notification_service_(NULL) {
}
virtual ~TestBrowserThreadImpl() {
@@ -30,7 +33,19 @@
Thread::set_message_loop(loop);
}
+ virtual void Init() OVERRIDE {
+ notification_service_ = new NotificationServiceImpl;
+ BrowserThreadImpl::Init();
+ }
+
+ virtual void CleanUp() OVERRIDE {
+ delete notification_service_;
+ notification_service_ = NULL;
+ BrowserThreadImpl::CleanUp();
+ }
+
private:
+ NotificationService* notification_service_;
DISALLOW_COPY_AND_ASSIGN(TestBrowserThreadImpl);
};
« no previous file with comments | « content/test/test_browser_context.cc ('k') | webkit/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698