async fn validate_light_sensor() -> Result<(), Error> {
    let watch_called = Arc::new(RwLock::new(false));

    let watch_called_clone = watch_called.clone();

    let (display_service, mut stream) =
        fidl::endpoints::create_proxy_and_stream::<DisplayMarker>().unwrap();

    fasync::Task::spawn(async move {
        while let Some(request) = stream.try_next().await.unwrap() {
            match request {
                DisplayRequest::WatchLightSensor { delta: _, responder } => {
                    *watch_called_clone.write() = true;
                    responder
                        .send(LightSensorData {
                            illuminance_lux: Some(100.0),
                            color: Some(fidl_fuchsia_ui_types::ColorRgb {
                                red: 25.0,
                                green: 16.0,
                                blue: 59.0,
                            }),
                            ..LightSensorData::EMPTY
                        })
                        .unwrap();
                }
                _ => {}
            }
        }
    })
    .detach();

    assert_watch!(display::command(display_service, None, None, None, true, None, None, None));
    assert_eq!(*watch_called.read(), true);
    Ok(())
}
// Can only check one mutate option at once
Can only check one mutate option at once
Can only check one mutate option at once
async fn validate_light_sensor() -> Result<(), Error> {
    let watch_called = Arc::new(RwLock::new(false));
    let watch_called_clone = watch_called.clone();
    let (display_service, mut stream) =
        fidl::endpoints::create_proxy_and_stream::<DisplayMarker>().unwrap();
    fasync::Task::spawn(async move {
        while let Some(request) = stream.try_next().await.unwrap() {
            match request {
                DisplayRequest::WatchLightSensor { delta: _, responder } => {
                    *watch_called_clone.write() = true;
                    responder
                        .send(LightSensorData {
                            illuminance_lux: Some(100.0),
                            color: Some(fidl_fuchsia_ui_types::ColorRgb {
                                red: 25.0,
                                green: 16.0,
                                blue: 59.0,
                            }),
                            ..LightSensorData::EMPTY
                        })
                        .unwrap();
                }
                _ => {}
            }
        }
    })
    .detach();
    assert_watch!(display::command(display_service, None, None, None, true, None, None, None));
    assert_eq!(*watch_called.read(), true);
    Ok(())
}
async fn validate_light_sensor ( ) -> Result < ( ) , Error > { let watch_called = Arc :: new ( RwLock :: new ( false ) ) ; let watch_called_clone = watch_called . clone ( ) ; let ( display_service , mut stream ) = fidl :: endpoints :: create_proxy_and_stream :: < DisplayMarker > ( ) . unwrap ( ) ; fasync :: Task :: spawn ( async move { while let Some ( request ) = stream . try_next ( ) . await . unwrap ( ) { match request { DisplayRequest :: WatchLightSensor { delta : _ , responder } => { * watch_called_clone . write ( ) = true ; responder . send ( LightSensorData { illuminance_lux : Some ( 100.0 ) , color : Some ( fidl_fuchsia_ui_types :: ColorRgb { red : 25.0 , green : 16.0 , blue : 59.0 , } ) , .. LightSensorData :: EMPTY } ) . unwrap ( ) ; } _ => { } } } } ) . detach ( ) ; assert_watch ! ( display command ( display_service None None None true None None None ) ) ; assert_eq ! ( watch_called read ( ) true ) ; Ok ( ( ) ) }
Can only check one mutate option at once
Can only check one mutate option at once