From 4499ff5785c7926f705d5abbdb46f20ba2e78f09 Mon Sep 17 00:00:00 2001 From: xhwang Date: Tue, 23 Feb 2016 16:55:58 -0800 Subject: Revert of mojo: Delay ApplicationTestBase shell disconnection. (patchset #3 id:60001 of https://chromiumcodereview.appspot.com/1709173002/ ) Reason for revert: Revert this for now to investigate crash on Windows. Original issue's description: > mojo: Delay ApplicationTestBase shell disconnection. > > BUG=587523 > TEST=Reenable tests. > > Committed: https://crrev.com/74cb68fa1c313c885c6022eea11ef6855d9ca0da > Cr-Commit-Position: refs/heads/master@{#377068} TBR=rockot@chromium.org,msw@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=587523 Review URL: https://codereview.chromium.org/1728063002 Cr-Commit-Position: refs/heads/master@{#377160} --- mojo/shell/public/cpp/application_test_base.h | 1 - mojo/shell/public/cpp/lib/application_test_base.cc | 22 +++++++++------------- mojo/tools/data/apptests | 10 ++++++---- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/mojo/shell/public/cpp/application_test_base.h b/mojo/shell/public/cpp/application_test_base.h index 65f86e3..f8ff6ad 100644 --- a/mojo/shell/public/cpp/application_test_base.h +++ b/mojo/shell/public/cpp/application_test_base.h @@ -75,7 +75,6 @@ class ApplicationTestBase : public testing::Test { private: scoped_ptr test_helper_; - bool use_default_run_loop_ = false; MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); }; diff --git a/mojo/shell/public/cpp/lib/application_test_base.cc b/mojo/shell/public/cpp/lib/application_test_base.cc index a6d253d..f9a726d 100644 --- a/mojo/shell/public/cpp/lib/application_test_base.cc +++ b/mojo/shell/public/cpp/lib/application_test_base.cc @@ -135,16 +135,9 @@ TestHelper::~TestHelper() { shell_connection_.reset(); } -ApplicationTestBase::ApplicationTestBase() {} +ApplicationTestBase::ApplicationTestBase() : test_helper_(nullptr) {} ApplicationTestBase::~ApplicationTestBase() { - CHECK(!g_shell_client_request.is_pending()); - CHECK(!g_shell); - - test_helper_.reset(); - - if (use_default_run_loop_) - Environment::DestroyDefaultRunLoop(); } ShellClient* ApplicationTestBase::GetShellClient() { @@ -154,12 +147,8 @@ ShellClient* ApplicationTestBase::GetShellClient() { void ApplicationTestBase::SetUp() { // A run loop is recommended for ShellConnection initialization and // communication. - // Check this in SetUp() instead of in the constructor because we cannot call - // virtual methods in the constructor. - if (ShouldCreateDefaultRunLoop()) { - use_default_run_loop_ = true; + if (ShouldCreateDefaultRunLoop()) Environment::InstantiateDefaultRunLoop(); - } CHECK(g_shell_client_request.is_pending()); CHECK(g_shell); @@ -169,6 +158,13 @@ void ApplicationTestBase::SetUp() { } void ApplicationTestBase::TearDown() { + CHECK(!g_shell_client_request.is_pending()); + CHECK(!g_shell); + + test_helper_.reset(); + + if (ShouldCreateDefaultRunLoop()) + Environment::DestroyDefaultRunLoop(); } bool ApplicationTestBase::ShouldCreateDefaultRunLoop() { diff --git a/mojo/tools/data/apptests b/mojo/tools/data/apptests index 594ca9b..a67ff16 100644 --- a/mojo/tools/data/apptests +++ b/mojo/tools/data/apptests @@ -65,10 +65,12 @@ if config.target_os != config.OS_ANDROID: 'test': 'mojo:media_apptests', 'type': 'gtest_isolated', }, - { - 'test': 'mojo:media_pipeline_integration_apptests', - 'type': 'gtest_isolated', - }, + # TODO(media): these tests fail in debug, which has no bot-coverage. + # http://crbug.com/587523 +# { +# 'test': 'mojo:media_pipeline_integration_apptests', +# 'type': 'gtest_isolated', +# }, # TODO(rockot): Flaky. Re-enable when brokering is sorted out. # http://crbug.com/569367. # { -- cgit v1.1