| Index: content/test/content_test_suite.cc
|
| diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc
|
| index 2cfc1e590756f0e6ccf2ad71c74e1a9c90a2945f..377757056f69ead4c1c92f197c13ec9f5d28925f 100644
|
| --- a/content/test/content_test_suite.cc
|
| +++ b/content/test/content_test_suite.cc
|
| @@ -6,7 +6,9 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "content/browser/mock_content_browser_client.h"
|
| #include "content/common/content_client.h"
|
| +#include "content/common/notification_service.h"
|
| #include "content/test/test_content_client.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -18,19 +20,30 @@ class TestContentClientInitializer : public testing::EmptyTestEventListener {
|
| }
|
|
|
| virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
|
| + notification_service_.reset(new NotificationService());
|
| +
|
| DCHECK(!content::GetContentClient());
|
| content_client_.reset(new TestContentClient);
|
| content::SetContentClient(content_client_.get());
|
| +
|
| + content_browser_client_.reset(new content::MockContentBrowserClient());
|
| + content_client_->set_browser(content_browser_client_.get());
|
| }
|
|
|
| virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
|
| + notification_service_.reset();
|
| +
|
| DCHECK_EQ(content_client_.get(), content::GetContentClient());
|
| content::SetContentClient(NULL);
|
| content_client_.reset();
|
| +
|
| + content_browser_client_.reset();
|
| }
|
|
|
| private:
|
| + scoped_ptr<NotificationService> notification_service_;
|
| scoped_ptr<content::ContentClient> content_client_;
|
| + scoped_ptr<content::ContentBrowserClient> content_browser_client_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TestContentClientInitializer);
|
| };
|
|
|