Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
fuchsia
flutter
tests
fakes
mouse_source.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_MOUSE_SOURCE_H_
6
#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_MOUSE_SOURCE_H_
7
8
#include <fuchsia/ui/pointer/cpp/fidl.h>
9
10
#include "flutter/fml/logging.h"
11
12
namespace
flutter_runner::testing
{
13
14
// A test stub to act as the protocol server. A test can control what is sent
15
// back by this server implementation, via the ScheduleCallback call.
16
class
FakeMouseSource
:
public
fuchsia::ui::pointer::MouseSource {
17
public
:
18
// |fuchsia.ui.pointer.MouseSource|
19
void
Watch
(MouseSource::WatchCallback
callback
)
override
{
20
callback_ = std::move(
callback
);
21
}
22
23
// Have the server issue events to the client's hanging-get Watch call.
24
void
ScheduleCallback
(std::vector<fuchsia::ui::pointer::MouseEvent> events) {
25
FML_CHECK
(callback_) <<
"require a valid WatchCallback"
;
26
callback_(std::move(events));
27
}
28
29
private
:
30
// Client-side logic to invoke on Watch() call's return. A test triggers it
31
// with ScheduleCallback().
32
MouseSource::WatchCallback callback_;
33
};
34
35
}
// namespace flutter_runner::testing
36
37
#endif
// FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_MOUSE_SOURCE_H_
flutter_runner::testing::FakeMouseSource
Definition
mouse_source.h:16
flutter_runner::testing::FakeMouseSource::ScheduleCallback
void ScheduleCallback(std::vector< fuchsia::ui::pointer::MouseEvent > events)
Definition
mouse_source.h:24
flutter_runner::testing::FakeMouseSource::Watch
void Watch(MouseSource::WatchCallback callback) override
Definition
mouse_source.h:19
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition
fl_key_channel_responder.cc:120
FML_CHECK
#define FML_CHECK(condition)
Definition
logging.h:85
flutter_runner::testing
Definition
engine.h:33
Generated on Fri Apr 26 2024 06:14:29 for Flutter Engine by
1.9.8