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

Side by Side Diff: components/test/components_test_suite.cc

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Address comments. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « components/test/DEPS ('k') | content/browser/BUILD.gn » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/test/components_test_suite.h" 5 #include "components/test/components_test_suite.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/metrics/statistics_recorder.h" 14 #include "base/metrics/statistics_recorder.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/test/launcher/unit_test_launcher.h" 16 #include "base/test/launcher/unit_test_launcher.h"
17 #include "base/test/test_suite.h" 17 #include "base/test/test_suite.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "components/content_settings/core/common/content_settings_pattern.h" 19 #include "components/content_settings/core/common/content_settings_pattern.h"
20 #include "mojo/edk/embedder/embedder.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
22 #include "ui/base/ui_base_paths.h" 23 #include "ui/base/ui_base_paths.h"
23 #include "url/url_util.h" 24 #include "url/url_util.h"
24 25
25 #if !defined(OS_IOS) 26 #if !defined(OS_IOS)
26 #include "content/public/common/content_client.h" 27 #include "content/public/common/content_client.h"
27 #include "content/public/test/content_test_suite_base.h" 28 #include "content/public/test/content_test_suite_base.h"
28 #include "content/public/test/test_content_client_initializer.h" 29 #include "content/public/test/test_content_client_initializer.h"
29 #include "content/public/test/unittest_test_suite.h" 30 #include "content/public/test/unittest_test_suite.h"
(...skipping 16 matching lines...) Expand all
46 namespace { 47 namespace {
47 48
48 class ComponentsTestSuite : public base::TestSuite { 49 class ComponentsTestSuite : public base::TestSuite {
49 public: 50 public:
50 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} 51 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
51 52
52 private: 53 private:
53 void Initialize() override { 54 void Initialize() override {
54 base::TestSuite::Initialize(); 55 base::TestSuite::Initialize();
55 56
57 mojo::edk::Init();
58
56 // Initialize the histograms subsystem, so that any histograms hit in tests 59 // Initialize the histograms subsystem, so that any histograms hit in tests
57 // are correctly registered with the statistics recorder and can be queried 60 // are correctly registered with the statistics recorder and can be queried
58 // by tests. 61 // by tests.
59 base::StatisticsRecorder::Initialize(); 62 base::StatisticsRecorder::Initialize();
60 63
61 #if !defined(OS_IOS) 64 #if !defined(OS_IOS)
62 gl::GLSurfaceTestSupport::InitializeOneOff(); 65 gl::GLSurfaceTestSupport::InitializeOneOff();
63 66
64 // Setup content scheme statics. 67 // Setup content scheme statics.
65 { 68 {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 testing::TestEventListeners& listeners = 162 testing::TestEventListeners& listeners =
160 testing::UnitTest::GetInstance()->listeners(); 163 testing::UnitTest::GetInstance()->listeners();
161 listeners.Append(new ComponentsUnitTestEventListener()); 164 listeners.Append(new ComponentsUnitTestEventListener());
162 165
163 #if !defined(OS_IOS) 166 #if !defined(OS_IOS)
164 return base::Bind(&content::UnitTestTestSuite::Run, std::move(test_suite)); 167 return base::Bind(&content::UnitTestTestSuite::Run, std::move(test_suite));
165 #else 168 #else
166 return base::Bind(&base::TestSuite::Run, std::move(test_suite)); 169 return base::Bind(&base::TestSuite::Run, std::move(test_suite));
167 #endif 170 #endif
168 } 171 }
OLDNEW
« no previous file with comments | « components/test/DEPS ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698