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

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

Issue 11649032: Flush SequenceWorkerPool tasks after each unit test. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | « content/browser/browser_thread_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698