Commit f3d24ad5 authored by erg's avatar erg Committed by Commit bot

Ensure the services gpu tests run with ozone.

When I moved mus_gpu_unittests into service_unittests, I didn't copy the
ozone initialization into the new test runner.

BUG=722546

Review-Url: https://codereview.chromium.org/2907663003
Cr-Commit-Position: refs/heads/master@{#474908}
parent 10be211f
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/ui.gni")
source_set("run_all_service_tests") { source_set("run_all_service_tests") {
# This target is in a separate directory because we want to expand DEPS so # This target is in a separate directory because we want to expand DEPS so
# that it not all of //services can access //ui. # that it not all of //services can access //ui.
...@@ -27,4 +29,8 @@ source_set("run_all_service_tests") { ...@@ -27,4 +29,8 @@ source_set("run_all_service_tests") {
if (is_android) { if (is_android) {
deps += [ "//mojo/android:libsystem_java" ] deps += [ "//mojo/android:libsystem_java" ]
} }
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
} }
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif
namespace { namespace {
class ServiceTestSuite : public base::TestSuite { class ServiceTestSuite : public base::TestSuite {
...@@ -26,6 +30,12 @@ class ServiceTestSuite : public base::TestSuite { ...@@ -26,6 +30,12 @@ class ServiceTestSuite : public base::TestSuite {
base::FilePath ui_test_pak_path; base::FilePath ui_test_pak_path;
ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
#if defined(USE_OZONE)
ui::OzonePlatform::InitParams params;
params.single_process = true;
ui::OzonePlatform::InitializeForGPU(params);
#endif
} }
void Shutdown() override { void Shutdown() override {
......
...@@ -57,23 +57,6 @@ source_set("server_gpu") { ...@@ -57,23 +57,6 @@ source_set("server_gpu") {
] ]
} }
source_set("run_all_service_tests") {
testonly = true
sources = [
"run_all_service_tests.cc",
]
deps = [
"//base/test:test_support",
"//mojo/edk/system",
]
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
}
source_set("task_runner_test_base") { source_set("task_runner_test_base") {
testonly = true testonly = true
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
#include "mojo/edk/embedder/embedder.h"
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif
class MusGpuTestSuite : public base::TestSuite {
public:
MusGpuTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
private:
void Initialize() override {
base::TestSuite::Initialize();
#if defined(USE_OZONE)
ui::OzonePlatform::InitParams params;
params.single_process = true;
ui::OzonePlatform::InitializeForGPU(params);
#endif
}
};
int main(int argc, char** argv) {
MusGpuTestSuite test_suite(argc, argv);
mojo::edk::Init();
return base::LaunchUnitTests(
argc, argv,
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment