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

Side by Side Diff: services/test/run_all_service_tests.cc

Issue 2907663003: Ensure the services gpu tests run with ozone. (Closed)
Patch Set: fix deps Created 3 years, 6 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 | « services/test/BUILD.gn ('k') | services/ui/common/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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/test/launcher/unit_test_launcher.h" 8 #include "base/test/launcher/unit_test_launcher.h"
9 #include "base/test/test_suite.h" 9 #include "base/test/test_suite.h"
10 #include "services/service_manager/public/cpp/test/common_initialization.h" 10 #include "services/service_manager/public/cpp/test/common_initialization.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/base/ui_base_paths.h" 12 #include "ui/base/ui_base_paths.h"
13 13
14 #if defined(USE_OZONE)
15 #include "ui/ozone/public/ozone_platform.h"
16 #endif
17
14 namespace { 18 namespace {
15 19
16 class ServiceTestSuite : public base::TestSuite { 20 class ServiceTestSuite : public base::TestSuite {
17 public: 21 public:
18 ServiceTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} 22 ServiceTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
19 ~ServiceTestSuite() override {} 23 ~ServiceTestSuite() override {}
20 24
21 protected: 25 protected:
22 void Initialize() override { 26 void Initialize() override {
23 base::TestSuite::Initialize(); 27 base::TestSuite::Initialize();
24 ui::RegisterPathProvider(); 28 ui::RegisterPathProvider();
25 29
26 base::FilePath ui_test_pak_path; 30 base::FilePath ui_test_pak_path;
27 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); 31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
28 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); 32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
33
34 #if defined(USE_OZONE)
35 ui::OzonePlatform::InitParams params;
36 params.single_process = true;
37 ui::OzonePlatform::InitializeForGPU(params);
38 #endif
29 } 39 }
30 40
31 void Shutdown() override { 41 void Shutdown() override {
32 ui::ResourceBundle::CleanupSharedInstance(); 42 ui::ResourceBundle::CleanupSharedInstance();
33 base::TestSuite::Shutdown(); 43 base::TestSuite::Shutdown();
34 } 44 }
35 45
36 private: 46 private:
37 DISALLOW_COPY_AND_ASSIGN(ServiceTestSuite); 47 DISALLOW_COPY_AND_ASSIGN(ServiceTestSuite);
38 }; 48 };
39 49
40 } // namespace 50 } // namespace
41 51
42 int main(int argc, char** argv) { 52 int main(int argc, char** argv) {
43 ServiceTestSuite test_suite(argc, argv); 53 ServiceTestSuite test_suite(argc, argv);
44 54
45 return service_manager::InitializeAndLaunchUnitTests( 55 return service_manager::InitializeAndLaunchUnitTests(
46 argc, argv, 56 argc, argv,
47 base::Bind(&ServiceTestSuite::Run, base::Unretained(&test_suite))); 57 base::Bind(&ServiceTestSuite::Run, base::Unretained(&test_suite)));
48 } 58 }
OLDNEW
« no previous file with comments | « services/test/BUILD.gn ('k') | services/ui/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698