fn send_update_and_poll_battery_client(
        exec: &mut fasync::TestExecutor,
        battery_client: &mut BatteryClient,
        upstream_battery_notifier: &fpower::BatteryInfoWatcherProxy,
        update: fpower::BatteryInfo,
    ) -> Result<BatteryInfo, BatteryClientError> {
        let update_fut = upstream_battery_notifier.on_change_battery_info(update);
        pin_mut!(update_fut);
        exec.run_until_stalled(&mut update_fut).expect_pending("waiting for fidl response");

        let item = expect_stream_item(exec, battery_client);
        // Once the BatteryClient receives the update, the FIDL method should resolve.
        assert_matches!(exec.run_until_stalled(&mut update_fut).expect("should resolve"), Ok(_));

        item
    }
/// Simulates a battery update by sending the `update` via the `upstream_battery_notifier`.
/// Expects the update to be received by the `battery_client` and returns the resulting
/// converted update result.
Simulates a battery update by sending the `update` via the `upstream_battery_notifier`.
Expects the update to be received by the `battery_client` and returns the resulting
converted update result.
Simulates a battery update by sending the ` update ` via the ` upstream_battery_notifier ` . Expects the update to be received by the ` battery_client ` and returns the resulting converted update result .
fn send_update_and_poll_battery_client(
        exec: &mut fasync::TestExecutor,
        battery_client: &mut BatteryClient,
        upstream_battery_notifier: &fpower::BatteryInfoWatcherProxy,
        update: fpower::BatteryInfo,
    ) -> Result<BatteryInfo, BatteryClientError> {
        let update_fut = upstream_battery_notifier.on_change_battery_info(update);
        pin_mut!(update_fut);
        exec.run_until_stalled(&mut update_fut).expect_pending("waiting for fidl response");
        let item = expect_stream_item(exec, battery_client);
        // Once the BatteryClient receives the update, the FIDL method should resolve.
        assert_matches!(exec.run_until_stalled(&mut update_fut).expect("should resolve"), Ok(_));
        item
    }
fn send_update_and_poll_battery_client ( exec : & mut fasync :: TestExecutor , battery_client : & mut BatteryClient , upstream_battery_notifier : & fpower :: BatteryInfoWatcherProxy , update : fpower :: BatteryInfo , ) -> Result < BatteryInfo , BatteryClientError > { let update_fut = upstream_battery_notifier . on_change_battery_info ( update ) ; pin_mut ! ( update_fut ) ; exec . run_until_stalled ( & mut update_fut ) . expect_pending ( " " ) ; let item = expect_stream_item ( exec , battery_client ) ; // Once the BatteryClient receives the update, the FIDL method should resolve. assert_matches ! ( exec run_until_stalled ( mut update_fut ) expect ( " " ) Ok ( ) ) ; item }
Simulates a battery update by sending the `update` via the `upstream_battery_notifier`.
Simulates a battery update by sending the ` update ` via the ` upstream_battery_notifier ` .
exec
&mut fasync::TestExecutor
battery_client
&mut BatteryClient
upstream_battery_notifier
&fpower::BatteryInfoWatcherProxy
update
fpower::BatteryInfo
exec
&mut fasync::TestExecutor
battery_client
&mut BatteryClient
upstream_battery_notifier
&fpower::BatteryInfoWatcherProxy
update
fpower::BatteryInfo