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
ce82cc65
Unverified
Commit
ce82cc65
authored
Feb 12, 2018
by
Vyacheslav Egorov
Committed by
GitHub
Feb 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Dart 2 issues in editable_text_test. (#14632)
Need to use `typed(any)` instead of `any` in Dart 2.
parent
33ea7f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+19
-19
No files found.
packages/flutter/test/widgets/editable_text_test.dart
View file @
ce82cc65
...
...
@@ -591,16 +591,16 @@ void main() {
controller
.
selection
=
new
TextSelection
.
collapsed
(
offset:
controller
.
text
.
length
);
controls
=
new
MockTextSelectionControls
();
when
(
controls
.
buildHandle
(
any
,
any
,
any
)).
thenReturn
(
new
Container
());
when
(
controls
.
buildToolbar
(
any
,
any
,
any
,
any
)).
thenReturn
(
new
Container
());
when
(
controls
.
buildHandle
(
typed
(
any
),
typed
(
any
),
typed
(
any
)
)).
thenReturn
(
new
Container
());
when
(
controls
.
buildToolbar
(
typed
(
any
),
typed
(
any
),
typed
(
any
),
typed
(
any
)
)).
thenReturn
(
new
Container
());
});
testWidgets
(
'are exposed'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
when
(
controls
.
canCopy
(
any
)).
thenReturn
(
false
);
when
(
controls
.
canCut
(
any
)).
thenReturn
(
false
);
when
(
controls
.
canPaste
(
any
)).
thenReturn
(
false
);
when
(
controls
.
canCopy
(
typed
(
any
)
)).
thenReturn
(
false
);
when
(
controls
.
canCut
(
typed
(
any
)
)).
thenReturn
(
false
);
when
(
controls
.
canPaste
(
typed
(
any
)
)).
thenReturn
(
false
);
await
_buildApp
(
controls
,
tester
);
await
tester
.
tap
(
find
.
byType
(
EditableText
));
...
...
@@ -614,7 +614,7 @@ void main() {
],
));
when
(
controls
.
canCopy
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCopy
(
typed
(
any
)
)).
thenReturn
(
true
);
await
_buildApp
(
controls
,
tester
);
expect
(
semantics
,
includesNodeWith
(
value:
'test'
,
...
...
@@ -625,8 +625,8 @@ void main() {
],
));
when
(
controls
.
canCopy
(
any
)).
thenReturn
(
false
);
when
(
controls
.
canPaste
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCopy
(
typed
(
any
)
)).
thenReturn
(
false
);
when
(
controls
.
canPaste
(
typed
(
any
)
)).
thenReturn
(
true
);
await
_buildApp
(
controls
,
tester
);
expect
(
semantics
,
includesNodeWith
(
value:
'test'
,
...
...
@@ -637,8 +637,8 @@ void main() {
],
));
when
(
controls
.
canPaste
(
any
)).
thenReturn
(
false
);
when
(
controls
.
canCut
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canPaste
(
typed
(
any
)
)).
thenReturn
(
false
);
when
(
controls
.
canCut
(
typed
(
any
)
)).
thenReturn
(
true
);
await
_buildApp
(
controls
,
tester
);
expect
(
semantics
,
includesNodeWith
(
value:
'test'
,
...
...
@@ -649,9 +649,9 @@ void main() {
],
));
when
(
controls
.
canCopy
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCut
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canPaste
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCopy
(
typed
(
any
)
)).
thenReturn
(
true
);
when
(
controls
.
canCut
(
typed
(
any
)
)).
thenReturn
(
true
);
when
(
controls
.
canPaste
(
typed
(
any
)
)).
thenReturn
(
true
);
await
_buildApp
(
controls
,
tester
);
expect
(
semantics
,
includesNodeWith
(
value:
'test'
,
...
...
@@ -670,9 +670,9 @@ void main() {
testWidgets
(
'can copy/cut/paste with a11y'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
when
(
controls
.
canCopy
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCut
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canPaste
(
any
)).
thenReturn
(
true
);
when
(
controls
.
canCopy
(
typed
(
any
)
)).
thenReturn
(
true
);
when
(
controls
.
canCut
(
typed
(
any
)
)).
thenReturn
(
true
);
when
(
controls
.
canPaste
(
typed
(
any
)
)).
thenReturn
(
true
);
await
_buildApp
(
controls
,
tester
);
await
tester
.
tap
(
find
.
byType
(
EditableText
));
await
tester
.
pump
();
...
...
@@ -703,13 +703,13 @@ void main() {
),
ignoreRect:
true
,
ignoreTransform:
true
));
owner
.
performAction
(
expectedNodeId
,
SemanticsAction
.
copy
);
verify
(
controls
.
handleCopy
(
any
)).
called
(
1
);
verify
(
controls
.
handleCopy
(
typed
(
any
)
)).
called
(
1
);
owner
.
performAction
(
expectedNodeId
,
SemanticsAction
.
cut
);
verify
(
controls
.
handleCut
(
any
)).
called
(
1
);
verify
(
controls
.
handleCut
(
typed
(
any
)
)).
called
(
1
);
owner
.
performAction
(
expectedNodeId
,
SemanticsAction
.
paste
);
verify
(
controls
.
handlePaste
(
any
)).
called
(
1
);
verify
(
controls
.
handlePaste
(
typed
(
any
)
)).
called
(
1
);
semantics
.
dispose
();
});
...
...
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