class FlatlandTest

Defined at line 189 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

Protected Members

ComponentContextProvider context_provider_
shared_ptr uber_struct_system_
::testing::StrictMock<MockFlatlandPresenter> * mock_flatland_presenter_
shared_ptr flatland_presenter_
allocation::MockBufferCollectionImporter * mock_buffer_collection_importer_
shared_ptr buffer_collection_importer_
vector flatlands_
vector flatland_displays_
unordered_map flatland_errors_
tvec2 display_pixel_ratio_
map pending_release_fences_
map pending_release_counters_
map requested_presentation_times_
unordered_map pending_instance_updates_
WireClient sysmem_allocator_

Public Methods

void FlatlandTest ()

Defined at line 191 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void SetUp ()

Defined at line 195 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void TearDown ()

Defined at line 252 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::shared_ptr<allocation::Allocator> CreateAllocator ()

Defined at line 264 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::shared_ptr<Flatland> CreateFlatland (const FlatlandConfig & config)

Defined at line 273 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::unique_ptr<FlatlandEventLoopClientServer> CreateFlatlandEventLoopClientServer ()

Defined at line 377 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::shared_ptr<FlatlandDisplay> CreateFlatlandDisplay (uint32_t width_in_px, uint32_t height_in_px)

Defined at line 382 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

fidl::ClientEnd<fuchsia_sysmem2::BufferCollectionToken> CreateToken ()

Defined at line 398 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void ApplySessionUpdatesAndSignalFences ()

Applies the most recently scheduled session update for each session and signals the release

fences of all Presents up to and including that update.

Defined at line 415 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::vector<scheduling::PresentId> GetRegisteredPresents (scheduling::SessionId session_id)

Gets the list of registered PresentIds for a particular |session_id|.

Defined at line 444 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

bool HasSessionUpdate (scheduling::SessionId session_id)

Returns true if |session_id| currently has a session update pending.

Defined at line 457 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::optional<zx::time> GetRequestedPresentationTime (scheduling::SchedulingIdPair id_pair)

Returns the requested presentation time for a particular |id_pair|, or std::nullopt if that

pair has not had a presentation scheduled for it.

Defined at line 463 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

bool IsDescendantOf (TransformHandle parent, TransformHandle child)

The parent transform must be a topology root or ComputeGlobalTopologyData() will crash.

Defined at line 472 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

std::shared_ptr<const UberStruct> GetUberStruct (Flatland * flatland)

Snapshots the UberStructSystem and fetches the UberStruct associated with |flatland|. If no

UberStruct exists for |flatland|, returns nullptr.

Defined at line 487 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void UpdateLinks (TransformHandle root_transform)

Updates all Links reachable from |root_transform|, which must be the root transform of one of

the active Flatland instances.

Tests that call this function are testing both Flatland and LinkSystem::UpdateLinkWatchers().

Defined at line 507 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void PresentWithArgs (Flatland * flatland, PresentArgs args, bool expect_success, cpp20::source_location location)

Calls Present() on a Flatland object and immediately triggers the session update

for all sessions so that changes from that Present() are visible in global systems. This is

primarily useful for testing the user-facing Flatland API.

|flatland| is a Flatland object constructed with the MockFlatlandPresenter owned by the

FlatlandTest harness. |expect_success| should be false if the call to Present() is expected to

trigger an error.

Defined at line 533 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void PresentWithArgs (const std::shared_ptr<Flatland> & flatland, PresentArgs args, bool expect_success, cpp20::source_location location)

Defined at line 571 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void Present (Flatland * flatland, bool expect_success, cpp20::source_location location)

Defined at line 577 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void Present (const std::shared_ptr<Flatland> & flatland, bool expect_success, cpp20::source_location location)

Defined at line 582 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void CreateViewport (Flatland * parent, Flatland * child, ContentId viewport_id, fidl::ServerEnd<fuchsia_ui_composition::ChildViewWatcher> child_view_watcher, fidl::ServerEnd<fuchsia_ui_composition::ParentViewportWatcher> parent_viewport_watcher)

Defined at line 587 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void SetDisplayContent (FlatlandDisplay * display, Flatland * child, fidl::ServerEnd<fuchsia_ui_composition::ChildViewWatcher> child_view_watcher_server_end, fidl::ServerEnd<fuchsia_ui_composition::ParentViewportWatcher> parent_viewport_watcher_server_end)

Defined at line 616 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void RegisterBufferCollection (allocation::Allocator * allocator, fuchsia_ui_composition::BufferCollectionExportToken bc_export_token, fidl::ClientEnd<fuchsia_sysmem2::BufferCollectionToken> token, bool expect_success, cpp20::source_location location)

Defined at line 639 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

void RegisterBufferCollection (const std::shared_ptr<allocation::Allocator> & allocator, fuchsia_ui_composition::BufferCollectionExportToken bc_export_token, fidl::ClientEnd<fuchsia_sysmem2::BufferCollectionToken> token, bool expect_success, cpp20::source_location location)

Defined at line 664 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

GlobalIdPair CreateImage (Flatland * flatland, allocation::Allocator * allocator, ContentId image_id, allocation::cpp::BufferCollectionImportExportTokens buffer_collection_import_export_tokens, fuchsia_ui_composition::ImageProperties properties)

Helper function to create an image, registering it with sysmem and flatland, and presenting.

Defined at line 674 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

fuchsia_ui_composition::FlatlandError GetFlatlandError (scheduling::SessionId session_id)

Checks the output of GetFlatlandError() for a particular session.

Defined at line 713 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

Records