blob: cc058677f2fb709ef4c36f426a3bec98026b90e0 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
fidl_fuchsia_sys2::{ChildRef, RealmMarker},
fuchsia_async as fasync,
fuchsia_component::client::{connect_to_protocol_at_dir_root, connect_to_service},
async fn base_resolver_test() {
let realm =
connect_to_service::<RealmMarker>().expect("failed to connect to fuchsia.sys2.Realm");
let (exposed_dir, server_end) = create_proxy().expect("failed to create proxy");
.bind_child(&mut ChildRef { name: "component".into(), collection: None }, server_end)
.expect("failed to call bind child FIDL")
.expect("failed to bind child");
let ping = connect_to_protocol_at_dir_root::<PingMarker>(&exposed_dir)
.expect("failed to connect to Ping protocol");
assert_eq!("ping").await.expect("Ping FIDL call failed"), "ping pong");