Index: content/public/test/content_test_suite_base.cc |
=================================================================== |
--- content/public/test/content_test_suite_base.cc (revision 186525) |
+++ content/public/test/content_test_suite_base.cc (working copy) |
@@ -8,10 +8,13 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/test/test_suite.h" |
+#include "base/threading/sequenced_worker_pool.h" |
+#include "content/browser/browser_thread_impl.h" |
#include "content/common/url_schemes.h" |
#include "content/public/common/content_client.h" |
#include "content/public/common/content_paths.h" |
#include "media/base/media.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
#include "ui/base/ui_base_paths.h" |
#include "ui/compositor/compositor_setup.h" |
@@ -26,6 +29,17 @@ |
namespace content { |
+class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { |
+ public: |
+ ContentTestSuiteBaseListener() { |
+ } |
+ virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { |
+ BrowserThreadImpl::FlushThreadPoolHelper(); |
+ } |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ContentTestSuiteBaseListener); |
+}; |
+ |
ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) |
: base::TestSuite(argc, argv), |
external_libraries_enabled_(true) { |
@@ -57,6 +71,9 @@ |
// Mock out the compositor on platforms that use it. |
ui::SetupTestCompositor(); |
+ |
+ testing::UnitTest::GetInstance()->listeners().Append( |
+ new ContentTestSuiteBaseListener); |
} |
} // namespace content |