Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
376d8baa
Unverified
Commit
376d8baa
authored
Mar 13, 2023
by
Bruno Leroux
Committed by
GitHub
Mar 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove key simulation obsolete comments (#122389)
Remove key simulation obsolete comments
parent
ad5deb86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
26 deletions
+21
-26
controller.dart
packages/flutter_test/lib/src/controller.dart
+15
-14
event_simulation.dart
packages/flutter_test/lib/src/event_simulation.dart
+6
-12
No files found.
packages/flutter_test/lib/src/controller.dart
View file @
376d8baa
...
@@ -132,12 +132,12 @@ class SemanticsController {
...
@@ -132,12 +132,12 @@ class SemanticsController {
/// See also:
/// See also:
///
///
/// * [containsSemantics] and [matchesSemantics], which can be used to match
/// * [containsSemantics] and [matchesSemantics], which can be used to match
/// against a single node in the traversal
/// against a single node in the traversal
.
/// * [containsAllInOrder], which can be given an [Iterable<Matcher>] to fuzzy
/// * [containsAllInOrder], which can be given an [Iterable<Matcher>] to fuzzy
/// match the order allowing extra nodes before after and between matching
/// match the order allowing extra nodes before after and between matching
/// parts of the traversal
/// parts of the traversal
.
/// * [orderedEquals], which can be given an [Iterable<Matcher>] to exactly
/// * [orderedEquals], which can be given an [Iterable<Matcher>] to exactly
/// match the order of the traversal
/// match the order of the traversal
.
Iterable
<
SemanticsNode
>
simulatedAccessibilityTraversal
({
Finder
?
start
,
Finder
?
end
})
{
Iterable
<
SemanticsNode
>
simulatedAccessibilityTraversal
({
Finder
?
start
,
Finder
?
end
})
{
TestAsyncUtils
.
guardSync
();
TestAsyncUtils
.
guardSync
();
final
List
<
SemanticsNode
>
traversal
=
<
SemanticsNode
>[];
final
List
<
SemanticsNode
>
traversal
=
<
SemanticsNode
>[];
...
@@ -784,8 +784,10 @@ abstract class WidgetController {
...
@@ -784,8 +784,10 @@ abstract class WidgetController {
///
///
/// The [WidgetTester] subclass implements this by deferring to the [binding].
/// The [WidgetTester] subclass implements this by deferring to the [binding].
///
///
/// See also [SchedulerBinding.endOfFrame], which returns a future that could
/// See also:
/// be appropriate to return in the implementation of this method.
///
/// * [SchedulerBinding.endOfFrame], which returns a future that could be
/// appropriate to return in the implementation of this method.
Future
<
void
>
pump
([
Duration
duration
]);
Future
<
void
>
pump
([
Duration
duration
]);
/// Repeatedly calls [pump] with the given `duration` until there are no
/// Repeatedly calls [pump] with the given `duration` until there are no
...
@@ -1110,8 +1112,9 @@ abstract class WidgetController {
...
@@ -1110,8 +1112,9 @@ abstract class WidgetController {
///
///
/// See also:
/// See also:
/// * [WidgetController.drag], a method to simulate a drag.
/// * [WidgetController.drag], a method to simulate a drag.
/// * [WidgetController.timedDrag], a method to simulate the drag of a given widget in a given duration.
/// * [WidgetController.timedDrag], a method to simulate the drag of a given
/// It sends move events at a given frequency and it is useful when there are listeners involved.
/// widget in a given duration. It sends move events at a given frequency and
/// it is useful when there are listeners involved.
/// * [WidgetController.fling], a method to simulate a fling.
/// * [WidgetController.fling], a method to simulate a fling.
Future
<
TestGesture
>
startGesture
(
Future
<
TestGesture
>
startGesture
(
Offset
downLocation
,
{
Offset
downLocation
,
{
...
@@ -1313,8 +1316,7 @@ abstract class WidgetController {
...
@@ -1313,8 +1316,7 @@ abstract class WidgetController {
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [platform.Platform.operatingSystem] to make the event appear to be from
/// [platform.Platform.operatingSystem] to make the event appear to be from
/// that type of system. Defaults to "web" on web, and "android" everywhere
/// that type of system. Defaults to "web" on web, and "android" everywhere
/// else. Must not be null. Some platforms (e.g. Windows, iOS) are not yet
/// else. Must not be null.
/// supported.
///
///
/// Specify the `physicalKey` for the event to override what is included in
/// Specify the `physicalKey` for the event to override what is included in
/// the simulated event. If not specified, it uses a default from the US
/// the simulated event. If not specified, it uses a default from the US
...
@@ -1359,8 +1361,7 @@ abstract class WidgetController {
...
@@ -1359,8 +1361,7 @@ abstract class WidgetController {
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [platform.Platform.operatingSystem] to make the event appear to be from
/// [platform.Platform.operatingSystem] to make the event appear to be from
/// that type of system. Defaults to "web" on web, and "android" everywhere
/// that type of system. Defaults to "web" on web, and "android" everywhere
/// else. Must not be null. Some platforms (e.g. Windows, iOS) are not yet
/// else. Must not be null.
/// supported.
///
///
/// Specify the `physicalKey` for the event to override what is included in
/// Specify the `physicalKey` for the event to override what is included in
/// the simulated event. If not specified, it uses a default from the US
/// the simulated event. If not specified, it uses a default from the US
...
@@ -1433,7 +1434,7 @@ abstract class WidgetController {
...
@@ -1433,7 +1434,7 @@ abstract class WidgetController {
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [platform.Platform.operatingSystem] to make the event appear to be from that type
/// [platform.Platform.operatingSystem] to make the event appear to be from that type
/// of system. Defaults to "web" on web, and "android" everywhere else. Must not be
/// of system. Defaults to "web" on web, and "android" everywhere else. Must not be
/// null.
Some platforms (e.g. Windows, iOS) are not yet supported.
/// null.
///
///
/// Specify the `physicalKey` for the event to override what is included in
/// Specify the `physicalKey` for the event to override what is included in
/// the simulated event. If not specified, it uses a default from the US
/// the simulated event. If not specified, it uses a default from the US
...
@@ -1639,12 +1640,12 @@ class LiveWidgetController extends WidgetController {
...
@@ -1639,12 +1640,12 @@ class LiveWidgetController extends WidgetController {
for
(
final
PointerEventRecord
record
in
records
)
{
for
(
final
PointerEventRecord
record
in
records
)
{
final
DateTime
now
=
clock
.
now
();
final
DateTime
now
=
clock
.
now
();
startTime
??=
now
;
startTime
??=
now
;
// So that the first event is promised to receive a zero timeDiff
// So that the first event is promised to receive a zero timeDiff
.
final
Duration
timeDiff
=
record
.
timeDelay
-
now
.
difference
(
startTime
);
final
Duration
timeDiff
=
record
.
timeDelay
-
now
.
difference
(
startTime
);
if
(
timeDiff
.
isNegative
)
{
if
(
timeDiff
.
isNegative
)
{
// This happens when something (e.g. GC) takes a long time during the
// This happens when something (e.g. GC) takes a long time during the
// processing of the events.
// processing of the events.
// Flush all past events
// Flush all past events
.
handleTimeStampDiff
.
add
(-
timeDiff
);
handleTimeStampDiff
.
add
(-
timeDiff
);
record
.
events
.
forEach
(
binding
.
handlePointerEvent
);
record
.
events
.
forEach
(
binding
.
handlePointerEvent
);
}
else
{
}
else
{
...
...
packages/flutter_test/lib/src/event_simulation.dart
View file @
376d8baa
...
@@ -742,8 +742,7 @@ class KeyEventSimulator {
...
@@ -742,8 +742,7 @@ class KeyEventSimulator {
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Keys that are down when the test completes are cleared after each test.
/// Keys that are down when the test completes are cleared after each test.
///
///
...
@@ -790,8 +789,7 @@ class KeyEventSimulator {
...
@@ -790,8 +789,7 @@ class KeyEventSimulator {
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Returns true if the key event was handled by the framework.
/// Returns true if the key event was handled by the framework.
///
///
...
@@ -835,8 +833,7 @@ class KeyEventSimulator {
...
@@ -835,8 +833,7 @@ class KeyEventSimulator {
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Returns true if the key event was handled by the framework.
/// Returns true if the key event was handled by the framework.
///
///
...
@@ -885,8 +882,7 @@ class KeyEventSimulator {
...
@@ -885,8 +882,7 @@ class KeyEventSimulator {
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Keys that are down when the test completes are cleared after each test.
/// Keys that are down when the test completes are cleared after each test.
///
///
...
@@ -920,8 +916,7 @@ Future<bool> simulateKeyDownEvent(
...
@@ -920,8 +916,7 @@ Future<bool> simulateKeyDownEvent(
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Returns true if the key event was handled by the framework.
/// Returns true if the key event was handled by the framework.
///
///
...
@@ -949,8 +944,7 @@ Future<bool> simulateKeyUpEvent(
...
@@ -949,8 +944,7 @@ Future<bool> simulateKeyUpEvent(
///
///
/// Specify `platform` as one of the platforms allowed in
/// Specify `platform` as one of the platforms allowed in
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// [Platform.operatingSystem] to make the event appear to be from that type of
/// system. Defaults to the operating system that the test is running on. Some
/// system. Defaults to the operating system that the test is running on.
/// platforms (e.g. Windows, iOS) are not yet supported.
///
///
/// Returns true if the key event was handled by the framework.
/// Returns true if the key event was handled by the framework.
///
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment