/// Starts Scenic in an isolated instance of component manager.
/// Injects required dependencies from the system or from the test, as needed.
/// Waits for the display to update at least |min_updates| times before returning.
Starts Scenic in an isolated instance of component manager.
Injects required dependencies from the system or from the test, as needed.
Waits for the display to update at least |min_updates| times before returning.
Starts Scenic in an isolated instance of component manager . Injects required dependencies from the system or from the test as needed . Waits for the display to update at least |min_updates| times before returning .
async fn init_scenic(min_updates: u64) -> (OpaqueTest, DisplayState) {
    let test = OpaqueTest::default(ROOT_URL).await.unwrap();
    let event_source = test.connect_to_event_source().await.unwrap();
    let display_state = DisplayState::new();
    // This directory is needed to start up Scenic's GFX subsystem.
    inject_from_test_namespace(
        "dev-display-controller",
        "/dev/class/display-controller",
        &event_source,
    )
    .await;
    // These directories provide access to the AEMU GPU, needed by Vulkan.
    inject_from_test_namespace(
        "dev-goldfish-address-space",
        "/dev/class/goldfish-address-space",
        &event_source,
    )
    .await;
    inject_from_test_namespace(
        "dev-goldfish-control",
        "/dev/class/goldfish-control",
        &event_source,
    )
    .await;
    inject_from_test_namespace("dev-goldfish-pipe", "/dev/class/goldfish-pipe", &event_source)
        .await;
    // Vulkan needs this directory for loading dynamic libraries
    inject_from_test_namespace("config-vulkan-icd.d", "/config/vulkan/icd.d", &event_source).await;
    // This is the protocol that is used to load Vulkan
    inject_from_test_namespace(
        "fuchsia.vulkan.loader.Loader",
        "/svc/fuchsia.vulkan.loader.Loader",
        &event_source,
    )
    .await;
    // Used by Vulkan
    inject_from_test_namespace(
        "fuchsia.sysmem.Allocator",
        "/svc/fuchsia.sysmem.Allocator",
        &event_source,
    )
    .await;
    // Scenic looks for a display using this protocol
    Arc::new(DisplayControllerProviderInjector::new(display_state.clone()))
        .inject(&event_source, EventMatcher::ok())
        .await;
    // Start all the components
    event_source.start_component_tree().await;
    info!("Waiting for {} display updates...", min_updates);
    // Wait for the display to update the minimum number of times
    while display_state.get_num_updates() < min_updates {}
    (test, display_state)
}
async fn init_scenic ( min_updates : u64 ) -> ( OpaqueTest , DisplayState ) { let test = OpaqueTest :: default ( ROOT_URL ) . await . unwrap ( ) ; let event_source = test . connect_to_event_source ( ) . await . unwrap ( ) ; let display_state = DisplayState :: new ( ) ; // This directory is needed to start up Scenic's GFX subsystem. inject_from_test_namespace ( " " , " " , & event_source , ) . await ; // These directories provide access to the AEMU GPU, needed by Vulkan. inject_from_test_namespace ( " " , " " , & event_source , ) . await ; inject_from_test_namespace ( " " , " " , & event_source , ) . await ; inject_from_test_namespace ( " " , " " , & event_source ) . await ; // Vulkan needs this directory for loading dynamic libraries inject_from_test_namespace ( " " , " " , & event_source ) . await ; // This is the protocol that is used to load Vulkan inject_from_test_namespace ( " " , " " , & event_source , ) . await ; // Used by Vulkan inject_from_test_namespace ( " " , " " , & event_source , ) . await ; // Scenic looks for a display using this protocol Arc :: new ( DisplayControllerProviderInjector :: new ( display_state . clone ( ) ) ) . inject ( & event_source , EventMatcher :: ok ( ) ) . await ; // Start all the components event_source . start_component_tree ( ) . await ; info ! ( " " min_updates ) ; // Wait for the display to update the minimum number of times while display_state . get_num_updates ( ) < min_updates { } ( test , display_state ) }
Starts Scenic in an isolated instance of component manager.
Starts Scenic in an isolated instance of component manager .
min_updates
u64