blob: 9d913946061f54c8b5075f02028b4fc5ba43a126 [file] [log] [blame]
// 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.
library fuchsia.ui.test.input;
@available(added=23)
type TestAppStatus = flexible enum : uint16 {
/// Must of input tests (mouse / touch) only require HANDLERS_REGISTERED.
/// HANDLERS_REGISTERED means test app has started and event handlers are
/// registered.
HANDLERS_REGISTERED = 0b001;
/// Keyboard related tests may require ELEMENT_FOCUSED status before inject
/// key events. For example Chromium related tests, event handler is
/// registered to a <textarea>, test suites should inject a touch event to
/// move focus to the <textarea> before inject key events.
ELEMENT_FOCUSED = 0b0010;
};
/// Test suites depend on test app status can listen to this listener.
@available(added=23)
@discoverable
open protocol TestAppStatusListener {
/// Notify that the test app is ready to receive input events.
///
/// Test app authors should call this method when they are ready
/// to process input events.
///
/// Test suites should wait for this call before injecting input
/// events.
strict ReportStatus(struct {
status TestAppStatus;
}) -> ();
};