template <typename Configuration>

class BackgroundDriverTest

Defined at line 321 of file ../../sdk/lib/driver/testing/cpp/driver_test.h

Background driver tests have the driver-under-test executing on a background driver dispatcher.

This allows for tests to use sync FIDL clients directly from their main test thread.

This is good for unit tests that more heavily exercise the driver-under-test through its exposed

FIDL services, rather than its public methods.

The test can run tasks on the driver context using the |RunInDriverContext()| methods, but sync

client tasks can be run directly on the main test thread.

Public Methods

void ~BackgroundDriverTest<Configuration> ()

Defined at line 325 of file ../../sdk/lib/driver/testing/cpp/driver_test.h

template <typename T>
T RunInDriverContext (fit::callback<T (DriverType &)> task)

Runs a task on the dispatcher context of the driver under test. This will be a different

thread than the main test thread, so be careful when capturing and returning pointers to

objects that live on different dispatchers like test fixture properties, or the environment.

Returns the result of the given task once it has completed.

Defined at line 333 of file ../../sdk/lib/driver/testing/cpp/driver_test.h

void RunInDriverContext (fit::callback<void (DriverType &)> task)

Runs a task on the dispatcher context of the driver under test. This will be a different

thread than the main test thread, so be careful when capturing and returning pointers to

objects that live on different dispatchers like test fixture properties, or the environment.

Returns when the given task has completed.

Defined at line 347 of file ../../sdk/lib/driver/testing/cpp/driver_test.h