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
2acd1708
Unverified
Commit
2acd1708
authored
Sep 16, 2020
by
Dan Field
Committed by
GitHub
Sep 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make parameter optional (#65444)
parent
021c2010
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
extension.dart
packages/flutter_driver/lib/src/extension/extension.dart
+6
-2
extension_test.dart
...es/flutter_driver/test/src/real_tests/extension_test.dart
+11
-11
No files found.
packages/flutter_driver/lib/src/extension/extension.dart
View file @
2acd1708
...
@@ -52,7 +52,7 @@ class _DriverBinding extends BindingBase with SchedulerBinding, ServicesBinding,
...
@@ -52,7 +52,7 @@ class _DriverBinding extends BindingBase with SchedulerBinding, ServicesBinding,
@override
@override
void
initServiceExtensions
()
{
void
initServiceExtensions
()
{
super
.
initServiceExtensions
();
super
.
initServiceExtensions
();
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
(
_handler
,
_silenceErrors
,
finders
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
(
_handler
,
_silenceErrors
,
finders
:
finders
);
registerServiceExtension
(
registerServiceExtension
(
name:
_extensionMethodName
,
name:
_extensionMethodName
,
callback:
extension
.
call
,
callback:
extension
.
call
,
...
@@ -171,7 +171,11 @@ abstract class FinderExtension {
...
@@ -171,7 +171,11 @@ abstract class FinderExtension {
@visibleForTesting
@visibleForTesting
class
FlutterDriverExtension
with
DeserializeFinderFactory
{
class
FlutterDriverExtension
with
DeserializeFinderFactory
{
/// Creates an object to manage a Flutter Driver connection.
/// Creates an object to manage a Flutter Driver connection.
FlutterDriverExtension
(
this
.
_requestDataHandler
,
this
.
_silenceErrors
,
List
<
FinderExtension
>
finders
)
{
FlutterDriverExtension
(
this
.
_requestDataHandler
,
this
.
_silenceErrors
,
{
List
<
FinderExtension
>
finders
=
const
<
FinderExtension
>[],
})
:
assert
(
finders
!=
null
)
{
_testTextInput
.
register
();
_testTextInput
.
register
();
_commandHandlers
.
addAll
(<
String
,
CommandHandlerCallback
>{
_commandHandlers
.
addAll
(<
String
,
CommandHandlerCallback
>{
...
...
packages/flutter_driver/test/src/real_tests/extension_test.dart
View file @
2acd1708
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
setUp
(()
{
setUp
(()
{
result
=
null
;
result
=
null
;
extension
=
FlutterDriverExtension
((
String
message
)
async
{
log
.
add
(
message
);
return
(
messageId
+=
1
).
toString
();
},
false
,
<
FinderExtension
>[]
);
extension
=
FlutterDriverExtension
((
String
message
)
async
{
log
.
add
(
message
);
return
(
messageId
+=
1
).
toString
();
},
false
);
});
});
testWidgets
(
'returns immediately when transient callback queue is empty'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'returns immediately when transient callback queue is empty'
,
(
WidgetTester
tester
)
async
{
...
@@ -98,7 +98,7 @@ void main() {
...
@@ -98,7 +98,7 @@ void main() {
setUp
(()
{
setUp
(()
{
result
=
null
;
result
=
null
;
extension
=
FlutterDriverExtension
((
String
message
)
async
{
log
.
add
(
message
);
return
(
messageId
+=
1
).
toString
();
},
false
,
<
FinderExtension
>[]
);
extension
=
FlutterDriverExtension
((
String
message
)
async
{
log
.
add
(
message
);
return
(
messageId
+=
1
).
toString
();
},
false
);
});
});
testWidgets
(
'waiting for NoTransientCallbacks returns immediately when transient callback queue is empty'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'waiting for NoTransientCallbacks returns immediately when transient callback queue is empty'
,
(
WidgetTester
tester
)
async
{
...
@@ -464,7 +464,7 @@ void main() {
...
@@ -464,7 +464,7 @@ void main() {
group
(
'getSemanticsId'
,
()
{
group
(
'getSemanticsId'
,
()
{
FlutterDriverExtension
extension
;
FlutterDriverExtension
extension
;
setUp
(()
{
setUp
(()
{
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
});
});
testWidgets
(
'works when semantics are enabled'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'works when semantics are enabled'
,
(
WidgetTester
tester
)
async
{
...
@@ -513,7 +513,7 @@ void main() {
...
@@ -513,7 +513,7 @@ void main() {
});
});
testWidgets
(
'getOffset'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'getOffset'
,
(
WidgetTester
tester
)
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
Offset
>
getOffset
(
OffsetType
offset
)
async
{
Future
<
Offset
>
getOffset
(
OffsetType
offset
)
async
{
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
ByValueKey
(
1
),
offset
).
serialize
();
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
ByValueKey
(
1
),
offset
).
serialize
();
...
@@ -545,7 +545,7 @@ void main() {
...
@@ -545,7 +545,7 @@ void main() {
testWidgets
(
'getText'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'getText'
,
(
WidgetTester
tester
)
async
{
await
silenceDriverLogger
(()
async
{
await
silenceDriverLogger
(()
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
String
>
getTextInternal
(
SerializableFinder
search
)
async
{
Future
<
String
>
getTextInternal
(
SerializableFinder
search
)
async
{
final
Map
<
String
,
String
>
arguments
=
GetText
(
search
,
timeout:
const
Duration
(
seconds:
1
)).
serialize
();
final
Map
<
String
,
String
>
arguments
=
GetText
(
search
,
timeout:
const
Duration
(
seconds:
1
)).
serialize
();
...
@@ -615,7 +615,7 @@ void main() {
...
@@ -615,7 +615,7 @@ void main() {
testWidgets
(
'descendant finder'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'descendant finder'
,
(
WidgetTester
tester
)
async
{
await
silenceDriverLogger
(()
async
{
await
silenceDriverLogger
(()
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
String
>
getDescendantText
({
String
of
,
bool
matchRoot
=
false
})
async
{
Future
<
String
>
getDescendantText
({
String
of
,
bool
matchRoot
=
false
})
async
{
final
Map
<
String
,
String
>
arguments
=
GetText
(
Descendant
(
final
Map
<
String
,
String
>
arguments
=
GetText
(
Descendant
(
...
@@ -660,7 +660,7 @@ void main() {
...
@@ -660,7 +660,7 @@ void main() {
testWidgets
(
'descendant finder firstMatchOnly'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'descendant finder firstMatchOnly'
,
(
WidgetTester
tester
)
async
{
await
silenceDriverLogger
(()
async
{
await
silenceDriverLogger
(()
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
String
>
getDescendantText
()
async
{
Future
<
String
>
getDescendantText
()
async
{
final
Map
<
String
,
String
>
arguments
=
GetText
(
Descendant
(
final
Map
<
String
,
String
>
arguments
=
GetText
(
Descendant
(
...
@@ -694,7 +694,7 @@ void main() {
...
@@ -694,7 +694,7 @@ void main() {
testWidgets
(
'ancestor finder'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ancestor finder'
,
(
WidgetTester
tester
)
async
{
await
silenceDriverLogger
(()
async
{
await
silenceDriverLogger
(()
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
Offset
>
getAncestorTopLeft
({
String
of
,
String
matching
,
bool
matchRoot
=
false
})
async
{
Future
<
Offset
>
getAncestorTopLeft
({
String
of
,
String
matching
,
bool
matchRoot
=
false
})
async
{
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
Ancestor
(
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
Ancestor
(
...
@@ -764,7 +764,7 @@ void main() {
...
@@ -764,7 +764,7 @@ void main() {
testWidgets
(
'ancestor finder firstMatchOnly'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ancestor finder firstMatchOnly'
,
(
WidgetTester
tester
)
async
{
await
silenceDriverLogger
(()
async
{
await
silenceDriverLogger
(()
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
Offset
>
getAncestorTopLeft
()
async
{
Future
<
Offset
>
getAncestorTopLeft
()
async
{
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
Ancestor
(
final
Map
<
String
,
String
>
arguments
=
GetOffset
(
Ancestor
(
...
@@ -812,7 +812,7 @@ void main() {
...
@@ -812,7 +812,7 @@ void main() {
});
});
testWidgets
(
'GetDiagnosticsTree'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'GetDiagnosticsTree'
,
(
WidgetTester
tester
)
async
{
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
final
FlutterDriverExtension
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
Future
<
Map
<
String
,
Object
>>
getDiagnosticsTree
(
DiagnosticsType
type
,
SerializableFinder
finder
,
{
int
depth
=
0
,
bool
properties
=
true
})
async
{
Future
<
Map
<
String
,
Object
>>
getDiagnosticsTree
(
DiagnosticsType
type
,
SerializableFinder
finder
,
{
int
depth
=
0
,
bool
properties
=
true
})
async
{
final
Map
<
String
,
String
>
arguments
=
GetDiagnosticsTree
(
finder
,
type
,
subtreeDepth:
depth
,
includeProperties:
properties
).
serialize
();
final
Map
<
String
,
String
>
arguments
=
GetDiagnosticsTree
(
finder
,
type
,
subtreeDepth:
depth
,
includeProperties:
properties
).
serialize
();
...
@@ -882,7 +882,7 @@ void main() {
...
@@ -882,7 +882,7 @@ void main() {
Map
<
String
,
dynamic
>
result
;
Map
<
String
,
dynamic
>
result
;
setUp
(()
{
setUp
(()
{
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
,
<
FinderExtension
>[]
);
extension
=
FlutterDriverExtension
((
String
arg
)
async
=>
''
,
true
);
result
=
null
;
result
=
null
;
});
});
...
...
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