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

Unified Diff: content/test/content_test_suite.cc

Issue 7708010: Add more files to content_unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual dtor Created 9 years, 4 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/content_test_suite.h ('k') | content/test/test_browser_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « content/test/content_test_suite.h ('k') | content/test/test_browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698