Commit 61347d57 authored by Joel Hockey's avatar Joel Hockey Committed by Chromium LUCI CQ

Add BUILD.gn for chromeos/process_proxy and compile it for lacros

Crosh (chrome-untrusted://crosh) will be hosted in lacros, and
process_proxy must be included in lacros.

Bug: 1161413
Change-Id: If4a082484291f06ec5c042c33eddb6976707824e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2608103Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840404}
parent 9bbfffbb
...@@ -162,7 +162,10 @@ group("gn_all") { ...@@ -162,7 +162,10 @@ group("gn_all") {
} }
if (is_chromeos_lacros) { if (is_chromeos_lacros) {
deps += [ "//chrome/test:lacros_chrome_browsertests" ] deps += [
"//chrome/test:lacros_chrome_browsertests",
"//chrome/test:lacros_chrome_unittests",
]
} }
if (!is_ios) { if (!is_ios) {
......
...@@ -1054,6 +1054,7 @@ static_library("extensions") { ...@@ -1054,6 +1054,7 @@ static_library("extensions") {
"//chromeos/login/auth", "//chromeos/login/auth",
"//chromeos/login/login_state", "//chromeos/login/login_state",
"//chromeos/network", "//chromeos/network",
"//chromeos/process_proxy",
"//chromeos/services/assistant/public/cpp", "//chromeos/services/assistant/public/cpp",
"//chromeos/services/ime/public/mojom", "//chromeos/services/ime/public/mojom",
"//chromeos/services/machine_learning/public/cpp", "//chromeos/services/machine_learning/public/cpp",
......
...@@ -3221,6 +3221,16 @@ if (!is_android) { ...@@ -3221,6 +3221,16 @@ if (!is_android) {
} }
if (is_chromeos_lacros) { if (is_chromeos_lacros) {
# This test target is intended for lacros chrome specific tests that depend
# on wayland, for generic tests, please use 'unit_tests' target instead.
test("lacros_chrome_unittests") {
use_xvfb = use_xvfb_in_this_config
deps = [
"//base/test:run_all_unittests",
"//chromeos/process_proxy:unit_tests",
]
}
# This test target is intended for lacros chrome specific tests that depend # This test target is intended for lacros chrome specific tests that depend
# on crosapi, for generic tests, please use 'browser_tests' target instead. # on crosapi, for generic tests, please use 'browser_tests' target instead.
test("lacros_chrome_browsertests") { test("lacros_chrome_browsertests") {
......
...@@ -74,12 +74,6 @@ component("chromeos") { ...@@ -74,12 +74,6 @@ component("chromeos") {
"printing/uri_impl.h", "printing/uri_impl.h",
"printing/usb_printer_id.cc", "printing/usb_printer_id.cc",
"printing/usb_printer_id.h", "printing/usb_printer_id.h",
"process_proxy/process_output_watcher.cc",
"process_proxy/process_output_watcher.h",
"process_proxy/process_proxy.cc",
"process_proxy/process_proxy.h",
"process_proxy/process_proxy_registry.cc",
"process_proxy/process_proxy_registry.h",
"scanning/scanner.cc", "scanning/scanner.cc",
"scanning/scanner.h", "scanning/scanner.h",
] ]
...@@ -174,6 +168,7 @@ test("chromeos_unittests") { ...@@ -174,6 +168,7 @@ test("chromeos_unittests") {
"//chromeos/memory/userspace_swap:unit_tests", "//chromeos/memory/userspace_swap:unit_tests",
"//chromeos/network:test_support", "//chromeos/network:test_support",
"//chromeos/network:unit_tests", "//chromeos/network:unit_tests",
"//chromeos/process_proxy:unit_tests",
"//chromeos/services:unit_tests", "//chromeos/services:unit_tests",
"//chromeos/settings:unit_tests", "//chromeos/settings:unit_tests",
"//chromeos/startup:unit_tests", "//chromeos/startup:unit_tests",
...@@ -213,8 +208,6 @@ test("chromeos_unittests") { ...@@ -213,8 +208,6 @@ test("chromeos_unittests") {
"printing/uri_unittest.h", "printing/uri_unittest.h",
"printing/uri_unittest_consistency.cc", "printing/uri_unittest_consistency.cc",
"printing/usb_printer_id_unittest.cc", "printing/usb_printer_id_unittest.cc",
"process_proxy/process_output_watcher_unittest.cc",
"process_proxy/process_proxy_unittest.cc",
"test/run_all_unittests.cc", "test/run_all_unittests.cc",
] ]
......
...@@ -16,6 +16,7 @@ component("lacros") { ...@@ -16,6 +16,7 @@ component("lacros") {
"//base", "//base",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chromeos/crosapi/mojom", "//chromeos/crosapi/mojom",
"//chromeos/process_proxy",
"//chromeos/startup", "//chromeos/startup",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
] ]
......
# Copyright 2020 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.
import("//build/config/chromeos/ui_mode.gni")
assert(is_chromeos_ash || is_chromeos_lacros,
"Non-Chrome-OS or Lacros builds must not depend on //chromeos")
component("process_proxy") {
defines = [ "IS_CHROMEOS_PROCESS_PROXY_IMPL" ]
sources = [
"process_output_watcher.cc",
"process_output_watcher.h",
"process_proxy.cc",
"process_proxy.h",
"process_proxy_registry.cc",
"process_proxy_registry.h",
]
deps = [ "//base" ]
}
source_set("unit_tests") {
testonly = true
deps = [
":process_proxy",
"//base",
"//base/test:test_support",
"//testing/gtest",
]
sources = [
"process_output_watcher_unittest.cc",
"process_proxy_unittest.cc",
]
}
joelhockey@chromium.org
tbarzic@chromium.org tbarzic@chromium.org
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#include <string> #include <string>
#include "base/callback.h" #include "base/callback.h"
#include "base/component_export.h"
#include "base/files/file.h" #include "base/files/file.h"
#include "base/files/file_descriptor_watcher_posix.h" #include "base/files/file_descriptor_watcher_posix.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chromeos/chromeos_export.h"
namespace chromeos { namespace chromeos {
...@@ -29,7 +29,7 @@ using ProcessOutputCallback = base::RepeatingCallback< ...@@ -29,7 +29,7 @@ using ProcessOutputCallback = base::RepeatingCallback<
// Observes output on |out_fd| and invokes |callback| when some output is // Observes output on |out_fd| and invokes |callback| when some output is
// detected. It assumes UTF8 output. // detected. It assumes UTF8 output.
class CHROMEOS_EXPORT ProcessOutputWatcher { class COMPONENT_EXPORT(CHROMEOS_PROCESS_PROXY) ProcessOutputWatcher {
public: public:
ProcessOutputWatcher(int out_fd, const ProcessOutputCallback& callback); ProcessOutputWatcher(int out_fd, const ProcessOutputCallback& callback);
~ProcessOutputWatcher(); ~ProcessOutputWatcher();
......
...@@ -11,20 +11,20 @@ ...@@ -11,20 +11,20 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/component_export.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/process_proxy/process_proxy.h" #include "chromeos/process_proxy/process_proxy.h"
namespace chromeos { namespace chromeos {
// Keeps track of all created ProcessProxies. It is created lazily and should // Keeps track of all created ProcessProxies. It is created lazily and should
// live on a single thread (where all methods must be called). // live on a single thread (where all methods must be called).
class CHROMEOS_EXPORT ProcessProxyRegistry { class COMPONENT_EXPORT(CHROMEOS_PROCESS_PROXY) ProcessProxyRegistry {
public: public:
using OutputCallback = using OutputCallback =
base::RepeatingCallback<void(const std::string& id, base::RepeatingCallback<void(const std::string& id,
......
...@@ -4633,6 +4633,18 @@ ...@@ -4633,6 +4633,18 @@
"test": "lacros_chrome_browsertests", "test": "lacros_chrome_browsertests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/" "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/"
}, },
{
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_gtest_merge.py"
},
"swarming": {
"can_use_on_swarming_builders": true,
"service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
},
"test": "lacros_chrome_unittests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_unittests/"
},
{ {
"merge": { "merge": {
"args": [], "args": [],
...@@ -5211,6 +5223,18 @@ ...@@ -5211,6 +5223,18 @@
"test": "lacros_chrome_browsertests", "test": "lacros_chrome_browsertests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/" "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/"
}, },
{
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_gtest_merge.py"
},
"swarming": {
"can_use_on_swarming_builders": true,
"service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
},
"test": "lacros_chrome_unittests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_unittests/"
},
{ {
"merge": { "merge": {
"args": [], "args": [],
......
...@@ -49823,6 +49823,24 @@ ...@@ -49823,6 +49823,24 @@
"test": "lacros_chrome_browsertests", "test": "lacros_chrome_browsertests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/" "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/"
}, },
{
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_gtest_merge.py"
},
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"os": "Ubuntu-16.04",
"ssd": "0"
}
],
"service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
},
"test": "lacros_chrome_unittests",
"test_id_prefix": "ninja://chrome/test:lacros_chrome_unittests/"
},
{ {
"merge": { "merge": {
"args": [], "args": [],
...@@ -1107,6 +1107,10 @@ ...@@ -1107,6 +1107,10 @@
"label": "//chrome/test:lacros_chrome_browsertests", "label": "//chrome/test:lacros_chrome_browsertests",
"type": "windowed_test_launcher", "type": "windowed_test_launcher",
}, },
"lacros_chrome_unittests": {
"label": "//chrome/test:lacros_chrome_unittests",
"type": "console_test_launcher",
},
"latency_unittests": { "latency_unittests": {
"label": "//ui/latency:latency_unittests", "label": "//ui/latency:latency_unittests",
"type": "console_test_launcher", "type": "console_test_launcher",
......
...@@ -3852,12 +3852,14 @@ ...@@ -3852,12 +3852,14 @@
}, },
}, },
'lacros_chrome_browsertests': {}, 'lacros_chrome_browsertests': {},
'lacros_chrome_unittests': {},
'ui_base_unittests': {}, 'ui_base_unittests': {},
'unit_tests': {}, 'unit_tests': {},
}, },
'linux_lacros_specific_gtests': { 'linux_lacros_specific_gtests': {
'lacros_chrome_browsertests': {}, 'lacros_chrome_browsertests': {},
'lacros_chrome_unittests': {},
}, },
'linux_ozone_common_gtests': { 'linux_ozone_common_gtests': {
......
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