tree: 01a02757b4ff9e4367a3c7e967dd0558f9822c7a [path history] [tgz]
  1. meta/
  2. BUILD.gn
  3. fake-coordinator-harness.cc
  4. fake-coordinator-harness.h
  5. fake-display-device-config.h
  6. fake-display-engine-harness.cc
  7. fake-display-engine-harness.h
  8. fake-display-stack.cc
  9. fake-display-stack.h
  10. fake-display-test.cc
  11. fake-display.cc
  12. fake-display.h
  13. fake-sysmem-device-hierarchy-unittest.cc
  14. fake-sysmem-device-hierarchy.cc
  15. fake-sysmem-device-hierarchy.h
  16. image-info.cc
  17. image-info.h
  18. README.md
  19. sysmem-service-forwarder-unittest.cc
  20. sysmem-service-forwarder.cc
  21. sysmem-service-forwarder.h
  22. sysmem-service-provider.h
src/graphics/display/lib/fake-display-stack/README.md

Fake Display Stack

The Fake Display Stack is a driver-like library providing a display engine (fake-display) and a Display Coordinator implementation within a hermetic testing environment. It serves a [fuchsia.hardware.display/Service] service instance independent of the one provided by the system Display Coordinator and display engine drivers. The fake display engine may use a fake sysmem instance, in which case tests won't impact real sysmem resources, such as the continuous memory pool.

Strictly speaking, the fake display stack is not a driver. It doesn't bind to device nodes nor run on driver hosts. However, its behavior is similar to the production display engine and coordinator drivers. It runs on driver dispatchers provided by the driver runtime with the same threading model as the drivers running in production under [Driver Framework v2][driver-framework].

Usage

The fake display stack is a test double of the display engine and coordinator drivers. We can use it either as a standalone component or as a library.

Run the fake-display-stack-host component

fake-display-stack-host is a standalone component hosting a fake display stack in a driver-like runtime environment. It exposes the [fuchsia.hardware.display/Service] service to other components over the component framework.

See the fake-display-stack-host README doc for more details.

Import FakeDisplayStack as a library

Tests may use the FakeDisplayStack library if they need to peek into the internal state of the display engine driver, or if they need to bring up their own Sysmem service.

Tests using the FakeDisplayStack library must manually manage its lifecycle. Typically, a test initializes a FakeDisplayStack during SetUp() and shuts it down during TearDown() for each test case.

Example: