summaryrefslogtreecommitdiffstats
path: root/components/html_viewer/ax_provider_impl_unittest.cc
diff options
context:
space:
mode:
authorskyostil <skyostil@chromium.org>2015-06-01 11:16:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-01 18:18:17 +0000
commit23e04e72e8121a372fcbaf779fde9faae2bc772f (patch)
treef4f3b53a2977222f3ef955214a002896ad4634b8 /components/html_viewer/ax_provider_impl_unittest.cc
parentff2fa0ca2adff9a5546a072c6f180df07dcd5fe1 (diff)
downloadchromium_src-23e04e72e8121a372fcbaf779fde9faae2bc772f.zip
chromium_src-23e04e72e8121a372fcbaf779fde9faae2bc772f.tar.gz
chromium_src-23e04e72e8121a372fcbaf779fde9faae2bc772f.tar.bz2
mojo: Fix Blink's shutdown sequence in AxProviderImplTest
This patch ensures the sequence used to tear down Blink in AxProviderImplTest matches the real implementation in RenderThreadImpl. Specifically, we need to shut down the scheduler before terminating Blink, because otherwise the scheduler might keep pointers to tasks that live on the Blink heap and access freed memory in its destructor. We also add an assertion to the renderer scheduler that it is shut down explicitly. Note that Blink cannot shut down the scheduler internally because of crbug.com/467369. We expect that this depedency can be cleaned up once the message loop is better integrated with the scheduler (crbug.com/465354) and when the Blink repository has been merged into Chromium. BUG=463143 Review URL: https://codereview.chromium.org/1145973011 Cr-Commit-Position: refs/heads/master@{#332221}
Diffstat (limited to 'components/html_viewer/ax_provider_impl_unittest.cc')
-rw-r--r--components/html_viewer/ax_provider_impl_unittest.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/html_viewer/ax_provider_impl_unittest.cc b/components/html_viewer/ax_provider_impl_unittest.cc
index 7508f8a..bfbd9a7 100644
--- a/components/html_viewer/ax_provider_impl_unittest.cc
+++ b/components/html_viewer/ax_provider_impl_unittest.cc
@@ -47,7 +47,8 @@ class TestWebViewClient : public WebViewClient {
class AxProviderImplTest : public testing::Test {
public:
AxProviderImplTest()
- : renderer_scheduler_(scheduler::RendererScheduler::Create()) {
+ : message_loop_(new base::MessageLoopForUI()),
+ renderer_scheduler_(scheduler::RendererScheduler::Create()) {
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
gin::V8Initializer::LoadV8Snapshot();
#endif
@@ -55,10 +56,14 @@ class AxProviderImplTest : public testing::Test {
new html_viewer::BlinkPlatformImpl(nullptr, renderer_scheduler_.get()));
}
- ~AxProviderImplTest() override { blink::shutdown(); }
+ ~AxProviderImplTest() override {
+ renderer_scheduler_->Shutdown();
+ message_loop_.reset();
+ blink::shutdown();
+ }
private:
- base::MessageLoopForUI message_loop;
+ scoped_ptr<base::MessageLoopForUI> message_loop_;
scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_;
};