| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=27) |
| library fuchsia.ui.test.context; |
| |
| using fuchsia.testing.harness; |
| using fuchsia.math; |
| |
| /// RealmFactory creates test realm for UI related tests, and give the realm |
| /// proxy to test suite so that test suite can access protocols in test realm. |
| /// Protocols served by Scenic, SceneManager and A11yManager are available. |
| @discoverable |
| open protocol RealmFactory { |
| flexible CreateRealm(resource table { |
| 1: realm_server server_end:fuchsia.testing.harness.RealmProxy; |
| 2: display_rotation uint32; |
| 3: device_pixel_ratio float32; |
| |
| /// Optional. If it has a value, the width and height must not be zero. |
| @available(added=NEXT) |
| 4: display_dimensions fuchsia.math.SizeU; |
| |
| /// Optional. If it has a value, it must not be zero. |
| @available(added=NEXT) |
| 5: display_refresh_rate_millihertz uint32; |
| |
| /// Optional. If it has a value, it must not be zero. |
| @available(added=NEXT) |
| 6: display_max_layer_count uint32; |
| }) -> () error fuchsia.testing.harness.OperationError; |
| }; |
| |
| /// Renderer type passed to scenic. |
| type RendererType = flexible enum { |
| /// Send all rendering operations to void. |
| NULL = 0; |
| /// Use CPU for rendering. |
| CPU = 1; |
| /// Use Vulkan for rendering. |
| VULKAN = 2; |
| }; |
| |
| /// ScenicRealmFactory creates test realm for Scenic related tests, and give |
| /// the realm proxy to test suite so that test suite can access protocols in |
| /// test realm. Only the protocols served by Scenic are available. |
| @discoverable |
| open protocol ScenicRealmFactory { |
| flexible CreateRealm(resource table { |
| 1: realm_server server_end:fuchsia.testing.harness.RealmProxy; |
| 2: renderer RendererType; |
| 3: display_rotation uint64; |
| 4: display_composition bool; |
| |
| /// Optional. If it has a value, the width and height must not be zero. |
| @available(added=NEXT) |
| 5: display_dimensions fuchsia.math.SizeU; |
| |
| /// Optional. If it has a value, it must not be zero. |
| @available(added=NEXT) |
| 6: display_refresh_rate_millihertz uint32; |
| |
| /// Optional. If it has a value, it must not be zero. |
| @available(added=NEXT) |
| 7: display_max_layer_count uint32; |
| }) -> () error fuchsia.testing.harness.OperationError; |
| }; |