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

Unified Diff: content/renderer/render_thread_impl_browsertest.cc

Issue 2309153002: Remove RenderThreadImpl::Shutdown (Closed)
Patch Set: temp Created 3 years, 11 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: content/renderer/render_thread_impl_browsertest.cc
diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc
index 38c5fc33790351b404ed95147e75b3bd5d3aadcd..dcdc702dc9cbf415a855b3d7c396c68a21debd9f 100644
--- a/content/renderer/render_thread_impl_browsertest.cc
+++ b/content/renderer/render_thread_impl_browsertest.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/debug/leak_annotations.h"
#include "base/location.h"
#include "base/memory/discardable_memory.h"
#include "base/run_loop.h"
@@ -33,6 +34,7 @@
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_content_client_initializer.h"
+#include "content/public/test/test_launcher.h"
#include "content/public/test/test_service_manager_context.h"
#include "content/renderer/render_process_impl.h"
#include "content/test/mock_render_process.h"
@@ -221,6 +223,17 @@ class RenderThreadImplBrowserTest : public testing::Test {
thread_->AddFilter(test_msg_filter_.get());
}
+ void TearDown() override {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ kSingleProcessTestsFlag)) {
+ // In a single-process mode, we need to avoid destructing mock_process_
+ // because it will call _exit(0) and kill the process before the browser
+ // side is ready to exit.
+ ANNOTATE_LEAKING_OBJECT_PTR(mock_process_.get());
+ mock_process_.release();
+ }
+ }
+
IPC::Sender* sender() { return channel_.get(); }
scoped_refptr<TestTaskCounter> test_task_counter_;

Powered by Google App Engine
This is Rietveld 408576698