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 257 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

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

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

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

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

std::unique_ptr<FlatlandEventLoopClientServer> CreateFlatlandEventLoopClientServer ()

Defined at line 383 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 388 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

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

Defined at line 404 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 421 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 450 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 463 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

bool ReleaseFencesContain (scheduling::SessionId session_id, const zx::object_base & expected_fence)

Returns true if the pending release fences for `session_id` contain `expected_fence`.

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

bool ReleaseCountersContain (scheduling::SessionId session_id, const zx::object_base & expected_counter)

Returns true if the pending release counters for `session_id` contain `expected_counter`.

Defined at line 484 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 501 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 510 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 526 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 546 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 573 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 611 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 617 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 622 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 627 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 656 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 679 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 704 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 714 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 753 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

Records