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

Side by Side Diff: ios/web/test/web_test_suite.cc

Issue 1406983008: [iOS] ios/web no longer depends on content::BrowserThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ios/web/test/test_web_thread_bundle_adapter.cc ('k') | ios/web/web_thread_adapter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/web/test/web_test_suite.h" 5 #include "ios/web/test/web_test_suite.h"
6 6
7 #include "base/macros.h"
7 #include "base/metrics/statistics_recorder.h" 8 #include "base/metrics/statistics_recorder.h"
9 #include "ios/web/web_thread_impl.h"
10 #include "testing/gtest/include/gtest/gtest.h"
8 11
9 namespace web { 12 namespace web {
10 13
14 class WebTestSuiteListener : public testing::EmptyTestEventListener {
15 public:
16 WebTestSuiteListener() {}
17 void OnTestEnd(const testing::TestInfo& test_info) override {
18 WebThreadImpl::FlushThreadPoolHelperForTesting();
19 }
20
21 private:
22 DISALLOW_COPY_AND_ASSIGN(WebTestSuiteListener);
23 };
24
11 WebTestSuite::WebTestSuite(int argc, char** argv) 25 WebTestSuite::WebTestSuite(int argc, char** argv)
12 : base::TestSuite(argc, argv) { 26 : base::TestSuite(argc, argv) {
13 } 27 }
14 28
15 WebTestSuite::~WebTestSuite() { 29 WebTestSuite::~WebTestSuite() {
16 } 30 }
17 31
18 void WebTestSuite::Initialize() { 32 void WebTestSuite::Initialize() {
19 base::TestSuite::Initialize(); 33 base::TestSuite::Initialize();
20 34
21 // Initialize the histograms subsystem, so that any histograms hit in tests 35 // Initialize the histograms subsystem, so that any histograms hit in tests
22 // are correctly registered with the statistics recorder and can be queried 36 // are correctly registered with the statistics recorder and can be queried
23 // by tests. 37 // by tests.
24 base::StatisticsRecorder::Initialize(); 38 base::StatisticsRecorder::Initialize();
39
40 testing::UnitTest::GetInstance()->listeners().Append(
41 new WebTestSuiteListener);
25 } 42 }
26 43
27 } // namespace web 44 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/test/test_web_thread_bundle_adapter.cc ('k') | ios/web/web_thread_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698