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

Unified Diff: content/public/test/test_service_manager_context.cc

Issue 2861503003: Isolate tests that initialize ServiceManagerConnection (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_service_manager_context.cc
diff --git a/content/public/test/test_service_manager_context.cc b/content/public/test/test_service_manager_context.cc
index 534647db84ac9ea7b36bbb5cd528ee18b0fa7f5d..f0b14bcbef8987566fad1739a669d5f1035a4c8e 100644
--- a/content/public/test/test_service_manager_context.cc
+++ b/content/public/test/test_service_manager_context.cc
@@ -6,11 +6,17 @@
#include "content/browser/child_process_launcher.h"
#include "content/browser/service_manager/service_manager_context.h"
+#include "content/public/common/service_manager_connection.h"
namespace content {
-TestServiceManagerContext::TestServiceManagerContext()
- : context_(new ServiceManagerContext) {}
+TestServiceManagerContext::TestServiceManagerContext() {
+ // Isolate from previous tests that may have already initialized
+ // ServiceManagerConnection (e.g. in
+ // RenderProcessHostImpl::InitializeChannelProxy()).
+ ServiceManagerConnection::DestroyForProcess();
+ context_.reset(new ServiceManagerContext);
+}
TestServiceManagerContext::~TestServiceManagerContext() {
ChildProcessLauncher::ResetRegisteredFilesForTesting();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698