Commit 37ae8be0 authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Get ApplicationConfigManager from component service directory.

ApplicationConfigManager is now available as a normal service, so
there is no need to reach it via ConnectToAgentService().

However, it must be reached via each component's service-directory,
rather than the CastRunner process' service-directory, since the Cast
components run in a different "session" from the Runner.

Bug: fuchsia:43004
Change-Id: I638cc3bca4d3d80f7f97a50d637065eb36f9d89a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089699
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755245}
parent 8168e4d2
......@@ -158,8 +158,8 @@ void CastRunner::StartComponent(
// Request the configuration for this application from the app_config_manager.
// This will return the configuration for the application, as well as the
// agent that should handle this application.
pending_component->agent_manager->ConnectToAgentService(
kAgentComponentUrl, pending_component->app_config_manager.NewRequest());
pending_component->startup_context->svc()->Connect(
pending_component->app_config_manager.NewRequest());
pending_component->app_config_manager.set_error_handler(
[this, pending_component = pending_component.get()](zx_status_t status) {
ZX_LOG(ERROR, status) << "ApplicationConfigManager disconnected.";
......
......@@ -216,7 +216,9 @@ class CastRunnerIntegrationTest : public testing::Test {
protected:
explicit CastRunnerIntegrationTest(
fuchsia::web::ContextFeatureFlags feature_flags) {
fuchsia::web::ContextFeatureFlags feature_flags)
: app_config_manager_binding_(&component_services_,
&app_config_manager_) {
EnsureFuchsiaDirSchemeInitialized();
// Create the CastRunner, published into |outgoing_directory_|.
......@@ -367,6 +369,8 @@ class CastRunnerIntegrationTest : public testing::Test {
// Incoming service directory, ComponentContext and per-component state.
sys::OutgoingDirectory component_services_;
base::fuchsia::ScopedServiceBinding<chromium::cast::ApplicationConfigManager>
app_config_manager_binding_;
std::unique_ptr<cr_fuchsia::FakeComponentContext> component_context_;
fuchsia::sys::ComponentControllerPtr component_controller_;
std::unique_ptr<sys::ServiceDirectory> component_services_client_;
......
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