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
07c548c6
Unverified
Commit
07c548c6
authored
Feb 13, 2023
by
Ian Hickson
Committed by
GitHub
Feb 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply BindingBase.checkInstance to TestDefaultBinaryMessengerBinding (#116937)
parent
865422da
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
135 additions
and
135 deletions
+135
-135
adaptive_text_selection_toolbar_test.dart
.../test/cupertino/adaptive_text_selection_toolbar_test.dart
+2
-2
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+1
-1
text_selection_test.dart
packages/flutter/test/cupertino/text_selection_test.dart
+2
-2
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+2
-2
adaptive_text_selection_toolbar_test.dart
...r/test/material/adaptive_text_selection_toolbar_test.dart
+1
-1
feedback_test.dart
packages/flutter/test/material/feedback_test.dart
+2
-2
feedback_tester.dart
packages/flutter/test/material/feedback_tester.dart
+3
-3
search_test.dart
packages/flutter/test/material/search_test.dart
+2
-2
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+2
-2
text_form_field_test.dart
packages/flutter/test/material/text_form_field_test.dart
+1
-1
text_selection_test.dart
packages/flutter/test/material/text_selection_test.dart
+2
-2
semantics_service_test.dart
packages/flutter/test/semantics/semantics_service_test.dart
+1
-1
browser_context_menu_test.dart
...ages/flutter/test/services/browser_context_menu_test.dart
+6
-6
default_binary_messenger_test.dart
.../flutter/test/services/default_binary_messenger_test.dart
+1
-1
deferred_component_test.dart
packages/flutter/test/services/deferred_component_test.dart
+2
-2
fake_platform_views.dart
packages/flutter/test/services/fake_platform_views.dart
+3
-3
haptic_feedback_test.dart
packages/flutter/test/services/haptic_feedback_test.dart
+2
-2
platform_channel_test.dart
packages/flutter/test/services/platform_channel_test.dart
+23
-23
platform_messages_test.dart
packages/flutter/test/services/platform_messages_test.dart
+4
-4
raw_keyboard_test.dart
packages/flutter/test/services/raw_keyboard_test.dart
+22
-22
system_chrome_test.dart
packages/flutter/test/services/system_chrome_test.dart
+8
-7
system_navigator_test.dart
packages/flutter/test/services/system_navigator_test.dart
+4
-4
system_sound_test.dart
packages/flutter/test/services/system_sound_test.dart
+1
-1
editable_text_shortcuts_test.dart
...es/flutter/test/widgets/editable_text_shortcuts_test.dart
+2
-2
router_test.dart
packages/flutter/test/widgets/router_test.dart
+1
-2
scrollable_selection_test.dart
packages/flutter/test/widgets/scrollable_selection_test.dart
+2
-2
selectable_region_test.dart
packages/flutter/test/widgets/selectable_region_test.dart
+2
-2
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+2
-2
text_selection_test.dart
packages/flutter/test/widgets/text_selection_test.dart
+4
-4
binding.dart
packages/flutter_test/lib/src/binding.dart
+5
-5
deprecated.dart
packages/flutter_test/lib/src/deprecated.dart
+6
-6
event_simulation.dart
packages/flutter_test/lib/src/event_simulation.dart
+1
-1
test_text_input.dart
packages/flutter_test/lib/src/test_text_input.dart
+8
-8
test_text_input_key_handler.dart
...ges/flutter_test/lib/src/test_text_input_key_handler.dart
+1
-1
widget_tester_test.dart
packages/flutter_test/test/widget_tester_test.dart
+4
-4
No files found.
packages/flutter/test/cupertino/adaptive_text_selection_toolbar_test.dart
View file @
07c548c6
...
@@ -13,7 +13,7 @@ void main() {
...
@@ -13,7 +13,7 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
);
);
...
@@ -23,7 +23,7 @@ void main() {
...
@@ -23,7 +23,7 @@ void main() {
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
null
,
null
,
);
);
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
07c548c6
...
@@ -159,7 +159,7 @@ class PathPointsMatcher extends Matcher {
...
@@ -159,7 +159,7 @@ class PathPointsMatcher extends Matcher {
void
main
(
)
{
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
// Returns the first RenderEditable.
// Returns the first RenderEditable.
RenderEditable
findRenderEditable
(
WidgetTester
tester
)
{
RenderEditable
findRenderEditable
(
WidgetTester
tester
)
{
...
...
packages/flutter/test/cupertino/text_selection_test.dart
View file @
07c548c6
...
@@ -82,7 +82,7 @@ void main() {
...
@@ -82,7 +82,7 @@ void main() {
}
}
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
);
);
...
@@ -92,7 +92,7 @@ void main() {
...
@@ -92,7 +92,7 @@ void main() {
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
null
,
null
,
);
);
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
07c548c6
...
@@ -546,7 +546,7 @@ void main() {
...
@@ -546,7 +546,7 @@ void main() {
bool
completed
;
bool
completed
;
completed
=
false
;
completed
=
false
;
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/assets'
,
(
ByteData
?
message
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/assets'
,
(
ByteData
?
message
)
async
{
expect
(
utf8
.
decode
(
message
!.
buffer
.
asUint8List
()),
'test'
);
expect
(
utf8
.
decode
(
message
!.
buffer
.
asUint8List
()),
'test'
);
completed
=
true
;
completed
=
true
;
return
ByteData
(
5
);
// 0x0000000000
return
ByteData
(
5
);
// 0x0000000000
...
@@ -573,7 +573,7 @@ void main() {
...
@@ -573,7 +573,7 @@ void main() {
});
});
expect
(
data
,
isFalse
);
expect
(
data
,
isFalse
);
expect
(
completed
,
isTrue
);
expect
(
completed
,
isTrue
);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/assets'
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/assets'
,
null
);
});
});
test
(
'Service extensions - exit'
,
()
async
{
test
(
'Service extensions - exit'
,
()
async
{
...
...
packages/flutter/test/material/adaptive_text_selection_toolbar_test.dart
View file @
07c548c6
...
@@ -16,7 +16,7 @@ void main() {
...
@@ -16,7 +16,7 @@ void main() {
setUp
(()
async
{
setUp
(()
async
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
);
);
...
...
packages/flutter/test/material/feedback_test.dart
View file @
07c548c6
...
@@ -27,14 +27,14 @@ void main () {
...
@@ -27,14 +27,14 @@ void main () {
setUp
(()
{
setUp
(()
{
semanticEvents
=
<
Map
<
String
,
Object
>>[];
semanticEvents
=
<
Map
<
String
,
Object
>>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
(
dynamic
message
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
(
dynamic
message
)
async
{
final
Map
<
dynamic
,
dynamic
>
typedMessage
=
message
as
Map
<
dynamic
,
dynamic
>;
final
Map
<
dynamic
,
dynamic
>
typedMessage
=
message
as
Map
<
dynamic
,
dynamic
>;
semanticEvents
.
add
(
typedMessage
.
cast
<
String
,
Object
>());
semanticEvents
.
add
(
typedMessage
.
cast
<
String
,
Object
>());
});
});
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
null
);
});
});
testWidgets
(
'forTap'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'forTap'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/material/feedback_tester.dart
View file @
07c548c6
...
@@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
...
@@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
/// cannot be used in combination with other classes that do the same.
/// cannot be used in combination with other classes that do the same.
class
FeedbackTester
{
class
FeedbackTester
{
FeedbackTester
()
{
FeedbackTester
()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
_handler
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
_handler
);
}
}
/// Number of times haptic feedback was requested (vibration).
/// Number of times haptic feedback was requested (vibration).
...
@@ -34,7 +34,7 @@ class FeedbackTester {
...
@@ -34,7 +34,7 @@ class FeedbackTester {
/// Stops tracking.
/// Stops tracking.
void
dispose
()
{
void
dispose
()
{
assert
(
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
SystemChannels
.
platform
.
name
,
_handler
));
assert
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
SystemChannels
.
platform
.
name
,
_handler
));
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
}
}
}
}
packages/flutter/test/material/search_test.dart
View file @
07c548c6
...
@@ -17,12 +17,12 @@ void main() {
...
@@ -17,12 +17,12 @@ void main() {
setUp
(()
async
{
setUp
(()
async
{
// Fill the clipboard so that the Paste option is available in the text
// Fill the clipboard so that the Paste option is available in the text
// selection menu.
// selection menu.
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'Clipboard data'
));
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'Clipboard data'
));
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
testWidgets
(
'Changing query moves cursor to the end of query'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Changing query moves cursor to the end of query'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/material/text_field_test.dart
View file @
07c548c6
...
@@ -176,7 +176,7 @@ void main() {
...
@@ -176,7 +176,7 @@ void main() {
setUp
(()
async
{
setUp
(()
async
{
debugResetSemanticsIdCounter
();
debugResetSemanticsIdCounter
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
);
);
...
@@ -186,7 +186,7 @@ void main() {
...
@@ -186,7 +186,7 @@ void main() {
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
null
,
null
,
);
);
...
...
packages/flutter/test/material/text_form_field_test.dart
View file @
07c548c6
...
@@ -17,7 +17,7 @@ import '../widgets/editable_text_utils.dart';
...
@@ -17,7 +17,7 @@ import '../widgets/editable_text_utils.dart';
void
main
(
)
{
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
setUp
(()
async
{
setUp
(()
async
{
// Fill the clipboard so that the Paste option is available in the text
// Fill the clipboard so that the Paste option is available in the text
...
...
packages/flutter/test/material/text_selection_test.dart
View file @
07c548c6
...
@@ -20,7 +20,7 @@ void main() {
...
@@ -20,7 +20,7 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
...
@@ -31,7 +31,7 @@ void main() {
...
@@ -31,7 +31,7 @@ void main() {
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
null
,
null
,
);
);
...
...
packages/flutter/test/semantics/semantics_service_test.dart
View file @
07c548c6
...
@@ -17,7 +17,7 @@ void main() {
...
@@ -17,7 +17,7 @@ void main() {
log
.
add
(
message
);
log
.
add
(
message
);
}
}
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
handleMessage
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
handleMessage
);
await
SemanticsService
.
announce
(
'announcement 1'
,
TextDirection
.
ltr
);
await
SemanticsService
.
announce
(
'announcement 1'
,
TextDirection
.
ltr
);
await
SemanticsService
.
announce
(
'announcement 2'
,
TextDirection
.
rtl
,
assertiveness:
Assertiveness
.
assertive
);
await
SemanticsService
.
announce
(
'announcement 2'
,
TextDirection
.
rtl
,
assertiveness:
Assertiveness
.
assertive
);
...
...
packages/flutter/test/services/browser_context_menu_test.dart
View file @
07c548c6
...
@@ -41,15 +41,15 @@ void main() {
...
@@ -41,15 +41,15 @@ void main() {
group
(
'disableContextMenu'
,
()
{
group
(
'disableContextMenu'
,
()
{
// Make sure the context menu is enabled (default) after the test.
// Make sure the context menu is enabled (default) after the test.
tearDown
(()
async
{
tearDown
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
{
return
null
;
return
null
;
});
});
await
BrowserContextMenu
.
enableContextMenu
();
await
BrowserContextMenu
.
enableContextMenu
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
});
});
test
(
'disableContextMenu calls its platform channel method'
,
()
async
{
test
(
'disableContextMenu calls its platform channel method'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -58,13 +58,13 @@ void main() {
...
@@ -58,13 +58,13 @@ void main() {
isMethodCall
(
'disableContextMenu'
,
arguments:
null
),
isMethodCall
(
'disableContextMenu'
,
arguments:
null
),
]);
]);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
});
});
});
});
group
(
'enableContextMenu'
,
()
{
group
(
'enableContextMenu'
,
()
{
test
(
'enableContextMenu calls its platform channel method'
,
()
async
{
test
(
'enableContextMenu calls its platform channel method'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -73,7 +73,7 @@ void main() {
...
@@ -73,7 +73,7 @@ void main() {
isMethodCall
(
'enableContextMenu'
,
arguments:
null
),
isMethodCall
(
'enableContextMenu'
,
arguments:
null
),
]);
]);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
contextMenu
,
null
);
});
});
});
});
},
},
...
...
packages/flutter/test/services/default_binary_messenger_test.dart
View file @
07c548c6
...
@@ -53,7 +53,7 @@ void main() {
...
@@ -53,7 +53,7 @@ void main() {
test
(
'can check the mock handler'
,
()
{
test
(
'can check the mock handler'
,
()
{
Future
<
ByteData
?>
handler
(
ByteData
?
call
)
=>
Future
<
ByteData
?>.
value
();
Future
<
ByteData
?>
handler
(
ByteData
?
call
)
=>
Future
<
ByteData
?>.
value
();
final
TestDefaultBinaryMessenger
messenger
=
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
;
final
TestDefaultBinaryMessenger
messenger
=
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
;
expect
(
messenger
.
checkMockMessageHandler
(
'test_channel'
,
null
),
true
);
expect
(
messenger
.
checkMockMessageHandler
(
'test_channel'
,
null
),
true
);
expect
(
messenger
.
checkMockMessageHandler
(
'test_channel'
,
handler
),
false
);
expect
(
messenger
.
checkMockMessageHandler
(
'test_channel'
,
handler
),
false
);
...
...
packages/flutter/test/services/deferred_component_test.dart
View file @
07c548c6
...
@@ -11,7 +11,7 @@ void main() {
...
@@ -11,7 +11,7 @@ void main() {
test
(
'installDeferredComponent test'
,
()
async
{
test
(
'installDeferredComponent test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -28,7 +28,7 @@ void main() {
...
@@ -28,7 +28,7 @@ void main() {
test
(
'uninstallDeferredComponent test'
,
()
async
{
test
(
'uninstallDeferredComponent test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
...
packages/flutter/test/services/fake_platform_views.dart
View file @
07c548c6
...
@@ -151,7 +151,7 @@ class FakeAndroidViewController implements AndroidViewController {
...
@@ -151,7 +151,7 @@ class FakeAndroidViewController implements AndroidViewController {
class
FakeAndroidPlatformViewsController
{
class
FakeAndroidPlatformViewsController
{
FakeAndroidPlatformViewsController
()
{
FakeAndroidPlatformViewsController
()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
}
}
Iterable
<
FakeAndroidPlatformView
>
get
views
=>
_views
.
values
;
Iterable
<
FakeAndroidPlatformView
>
get
views
=>
_views
.
values
;
...
@@ -370,7 +370,7 @@ class FakeAndroidPlatformViewsController {
...
@@ -370,7 +370,7 @@ class FakeAndroidPlatformViewsController {
class
FakeIosPlatformViewsController
{
class
FakeIosPlatformViewsController
{
FakeIosPlatformViewsController
()
{
FakeIosPlatformViewsController
()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
}
}
Iterable
<
FakeUiKitView
>
get
views
=>
_views
.
values
;
Iterable
<
FakeUiKitView
>
get
views
=>
_views
.
values
;
...
@@ -473,7 +473,7 @@ class FakeIosPlatformViewsController {
...
@@ -473,7 +473,7 @@ class FakeIosPlatformViewsController {
class
FakeHtmlPlatformViewsController
{
class
FakeHtmlPlatformViewsController
{
FakeHtmlPlatformViewsController
()
{
FakeHtmlPlatformViewsController
()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform_views
,
_onMethodCall
);
}
}
Iterable
<
FakeHtmlPlatformView
>
get
views
=>
_views
.
values
;
Iterable
<
FakeHtmlPlatformView
>
get
views
=>
_views
.
values
;
...
...
packages/flutter/test/services/haptic_feedback_test.dart
View file @
07c548c6
...
@@ -11,7 +11,7 @@ void main() {
...
@@ -11,7 +11,7 @@ void main() {
test
(
'Haptic feedback control test'
,
()
async
{
test
(
'Haptic feedback control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -26,7 +26,7 @@ void main() {
...
@@ -26,7 +26,7 @@ void main() {
Future
<
void
>
callAndVerifyHapticFunction
(
Future
<
void
>
Function
()
hapticFunction
,
String
platformMethodArgument
)
async
{
Future
<
void
>
callAndVerifyHapticFunction
(
Future
<
void
>
Function
()
hapticFunction
,
String
platformMethodArgument
)
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
...
packages/flutter/test/services/platform_channel_test.dart
View file @
07c548c6
This diff is collapsed.
Click to expand it.
packages/flutter/test/services/platform_messages_test.dart
View file @
07c548c6
...
@@ -14,18 +14,18 @@ void main() {
...
@@ -14,18 +14,18 @@ void main() {
test
(
'Mock binary message handler control test'
,
()
async
{
test
(
'Mock binary message handler control test'
,
()
async
{
final
List
<
ByteData
?>
log
=
<
ByteData
>[];
final
List
<
ByteData
?>
log
=
<
ByteData
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'test1'
,
(
ByteData
?
message
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'test1'
,
(
ByteData
?
message
)
async
{
log
.
add
(
message
);
log
.
add
(
message
);
return
null
;
return
null
;
});
});
final
ByteData
message
=
ByteData
(
2
)..
setUint16
(
0
,
0xABCD
);
final
ByteData
message
=
ByteData
(
2
)..
setUint16
(
0
,
0xABCD
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
send
(
'test1'
,
message
);
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
send
(
'test1'
,
message
);
expect
(
log
,
equals
(<
ByteData
>[
message
]));
expect
(
log
,
equals
(<
ByteData
>[
message
]));
log
.
clear
();
log
.
clear
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'test1'
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'test1'
,
null
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
send
(
'test1'
,
message
);
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
send
(
'test1'
,
message
);
expect
(
log
,
isEmpty
);
expect
(
log
,
isEmpty
);
});
});
}
}
packages/flutter/test/services/raw_keyboard_test.dart
View file @
07c548c6
This diff is collapsed.
Click to expand it.
packages/flutter/test/services/system_chrome_test.dart
View file @
07c548c6
...
@@ -12,7 +12,7 @@ void main() {
...
@@ -12,7 +12,7 @@ void main() {
testWidgets
(
'SystemChrome overlay style test'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'SystemChrome overlay style test'
,
(
WidgetTester
tester
)
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -70,7 +70,7 @@ void main() {
...
@@ -70,7 +70,7 @@ void main() {
test
(
'setPreferredOrientations control test'
,
()
async
{
test
(
'setPreferredOrientations control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -89,7 +89,7 @@ void main() {
...
@@ -89,7 +89,7 @@ void main() {
test
(
'setApplicationSwitcherDescription control test'
,
()
async
{
test
(
'setApplicationSwitcherDescription control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -108,7 +108,7 @@ void main() {
...
@@ -108,7 +108,7 @@ void main() {
test
(
'setApplicationSwitcherDescription missing plugin'
,
()
async
{
test
(
'setApplicationSwitcherDescription missing plugin'
,
()
async
{
final
List
<
ByteData
?>
log
=
<
ByteData
>[];
final
List
<
ByteData
?>
log
=
<
ByteData
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/platform'
,
(
ByteData
?
message
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/platform'
,
(
ByteData
?
message
)
async
{
log
.
add
(
message
);
log
.
add
(
message
);
return
null
;
return
null
;
});
});
...
@@ -120,10 +120,11 @@ void main() {
...
@@ -120,10 +120,11 @@ void main() {
expect
(
log
,
isNotEmpty
);
expect
(
log
,
isNotEmpty
);
});
});
test
(
'setEnabledSystemUIMode control test'
,
()
async
{
test
(
'setEnabledSystemUIMode control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -152,7 +153,7 @@ void main() {
...
@@ -152,7 +153,7 @@ void main() {
test
(
'setEnabledSystemUIMode passes correct overlays for manual configuration'
,
()
async
{
test
(
'setEnabledSystemUIMode passes correct overlays for manual configuration'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -169,7 +170,7 @@ void main() {
...
@@ -169,7 +170,7 @@ void main() {
test
(
'setSystemUIChangeCallback control test'
,
()
async
{
test
(
'setSystemUIChangeCallback control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
...
packages/flutter/test/services/system_navigator_test.dart
View file @
07c548c6
...
@@ -18,7 +18,7 @@ void main() {
...
@@ -18,7 +18,7 @@ void main() {
}
}
test
(
'System navigator control test - platform messages'
,
()
async
{
test
(
'System navigator control test - platform messages'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -27,11 +27,11 @@ void main() {
...
@@ -27,11 +27,11 @@ void main() {
isMethodCall
(
'SystemNavigator.pop'
,
arguments:
null
),
isMethodCall
(
'SystemNavigator.pop'
,
arguments:
null
),
]);
]);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
test
(
'System navigator control test - navigation messages'
,
()
async
{
test
(
'System navigator control test - navigation messages'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
@@ -56,6 +56,6 @@ void main() {
...
@@ -56,6 +56,6 @@ void main() {
isMethodCall
(
'routeInformationUpdated'
,
arguments:
<
String
,
dynamic
>{
'location'
:
'a'
,
'state'
:
true
,
'replace'
:
true
}),
isMethodCall
(
'routeInformationUpdated'
,
arguments:
<
String
,
dynamic
>{
'location'
:
'a'
,
'state'
:
true
,
'replace'
:
true
}),
]);
]);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
null
);
});
});
}
}
packages/flutter/test/services/system_sound_test.dart
View file @
07c548c6
...
@@ -12,7 +12,7 @@ void main() {
...
@@ -12,7 +12,7 @@ void main() {
test
(
'System sound control test'
,
()
async
{
test
(
'System sound control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
log
.
add
(
methodCall
);
return
null
;
return
null
;
});
});
...
...
packages/flutter/test/widgets/editable_text_shortcuts_test.dart
View file @
07c548c6
...
@@ -26,12 +26,12 @@ void main() {
...
@@ -26,12 +26,12 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
const
String
testText
=
const
String
testText
=
...
...
packages/flutter/test/widgets/router_test.dart
View file @
07c548c6
...
@@ -823,8 +823,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
...
@@ -823,8 +823,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
testWidgets
(
'PlatformRouteInformationProvider updates route information'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PlatformRouteInformationProvider updates route information'
,
(
WidgetTester
tester
)
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
TestDefaultBinaryMessengerBinding
TestDefaultBinaryMessengerBinding
.
instance
!
.
instance
.
defaultBinaryMessenger
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
(
MethodCall
methodCall
)
async
{
...
...
packages/flutter/test/widgets/scrollable_selection_test.dart
View file @
07c548c6
...
@@ -27,12 +27,12 @@ void main() {
...
@@ -27,12 +27,12 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
testWidgets
(
'mouse can select multiple widgets'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'mouse can select multiple widgets'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/widgets/selectable_region_test.dart
View file @
07c548c6
...
@@ -28,12 +28,12 @@ void main() {
...
@@ -28,12 +28,12 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
async
{
setUp
(()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
await
Clipboard
.
setData
(
const
ClipboardData
(
text:
'empty'
));
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
group
(
'SelectableRegion'
,
()
{
group
(
'SelectableRegion'
,
()
{
...
...
packages/flutter/test/widgets/selectable_text_test.dart
View file @
07c548c6
...
@@ -146,7 +146,7 @@ void main() {
...
@@ -146,7 +146,7 @@ void main() {
setUp
(()
async
{
setUp
(()
async
{
debugResetSemanticsIdCounter
();
debugResetSemanticsIdCounter
();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
,
mockClipboard
.
handleMethodCall
,
);
);
...
@@ -156,7 +156,7 @@ void main() {
...
@@ -156,7 +156,7 @@ void main() {
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
SystemChannels
.
platform
,
null
,
null
,
);
);
...
...
packages/flutter/test/widgets/text_selection_test.dart
View file @
07c548c6
...
@@ -1374,11 +1374,11 @@ void main() {
...
@@ -1374,11 +1374,11 @@ void main() {
group
(
'when Clipboard fails'
,
()
{
group
(
'when Clipboard fails'
,
()
{
setUp
(()
{
setUp
(()
{
final
MockClipboard
mockClipboard
=
MockClipboard
(
hasStringsThrows:
true
);
final
MockClipboard
mockClipboard
=
MockClipboard
(
hasStringsThrows:
true
);
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
test
(
'Clipboard API failure is gracefully recovered from'
,
()
async
{
test
(
'Clipboard API failure is gracefully recovered from'
,
()
async
{
...
@@ -1394,11 +1394,11 @@ void main() {
...
@@ -1394,11 +1394,11 @@ void main() {
final
MockClipboard
mockClipboard
=
MockClipboard
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
setUp
(()
{
setUp
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
mockClipboard
.
handleMethodCall
);
});
});
tearDown
(()
{
tearDown
(()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
});
test
(
'update sets value based on clipboard contents'
,
()
async
{
test
(
'update sets value based on clipboard contents'
,
()
async
{
...
...
packages/flutter_test/lib/src/binding.dart
View file @
07c548c6
...
@@ -99,7 +99,7 @@ mixin TestDefaultBinaryMessengerBinding on BindingBase, ServicesBinding {
...
@@ -99,7 +99,7 @@ mixin TestDefaultBinaryMessengerBinding on BindingBase, ServicesBinding {
}
}
/// The current [TestDefaultBinaryMessengerBinding], if one has been created.
/// The current [TestDefaultBinaryMessengerBinding], if one has been created.
static
TestDefaultBinaryMessengerBinding
?
get
instance
=>
_instance
;
static
TestDefaultBinaryMessengerBinding
get
instance
=>
BindingBase
.
checkInstance
(
_instance
)
;
static
TestDefaultBinaryMessengerBinding
?
_instance
;
static
TestDefaultBinaryMessengerBinding
?
_instance
;
@override
@override
...
@@ -775,10 +775,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
...
@@ -775,10 +775,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
assert
(
inTest
);
assert
(
inTest
);
// Set the handler only if there is currently none.
// Set the handler only if there is currently none.
if
(
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
if
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
))
{
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
))
{
_announcementHandler
=
_handleAnnouncementMessage
;
_announcementHandler
=
_handleAnnouncementMessage
;
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
_announcementHandler
);
SystemChannels
.
accessibility
,
_announcementHandler
);
}
}
...
@@ -1067,10 +1067,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
...
@@ -1067,10 +1067,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
_parentZone
=
null
;
_parentZone
=
null
;
buildOwner
!.
focusManager
.
dispose
();
buildOwner
!.
focusManager
.
dispose
();
if
(
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
if
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
_announcementHandler
))
{
SystemChannels
.
accessibility
.
name
,
_announcementHandler
))
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
(
SystemChannels
.
accessibility
,
null
);
.
setMockDecodedMessageHandler
(
SystemChannels
.
accessibility
,
null
);
_announcementHandler
=
null
;
_announcementHandler
=
null
;
}
}
...
...
packages/flutter_test/lib/src/deprecated.dart
View file @
07c548c6
...
@@ -27,7 +27,7 @@ extension TestBinaryMessengerExtension on BinaryMessenger {
...
@@ -27,7 +27,7 @@ extension TestBinaryMessengerExtension on BinaryMessenger {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
void
setMockMessageHandler
(
String
channel
,
MessageHandler
?
handler
)
{
void
setMockMessageHandler
(
String
channel
,
MessageHandler
?
handler
)
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMessageHandler
(
channel
,
handler
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMessageHandler
(
channel
,
handler
);
}
}
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
...
@@ -38,7 +38,7 @@ extension TestBinaryMessengerExtension on BinaryMessenger {
...
@@ -38,7 +38,7 @@ extension TestBinaryMessengerExtension on BinaryMessenger {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
bool
checkMockMessageHandler
(
String
channel
,
Object
?
handler
)
{
bool
checkMockMessageHandler
(
String
channel
,
Object
?
handler
)
{
return
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
channel
,
handler
);
return
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
channel
,
handler
);
}
}
}
}
...
@@ -59,7 +59,7 @@ extension TestBasicMessageChannelExtension<T> on BasicMessageChannel<T> {
...
@@ -59,7 +59,7 @@ extension TestBasicMessageChannelExtension<T> on BasicMessageChannel<T> {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
void
setMockMessageHandler
(
Future
<
T
>
Function
(
T
?
message
)?
handler
)
{
void
setMockMessageHandler
(
Future
<
T
>
Function
(
T
?
message
)?
handler
)
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
T
>(
this
,
handler
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
T
>(
this
,
handler
);
}
}
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
...
@@ -71,7 +71,7 @@ extension TestBasicMessageChannelExtension<T> on BasicMessageChannel<T> {
...
@@ -71,7 +71,7 @@ extension TestBasicMessageChannelExtension<T> on BasicMessageChannel<T> {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
bool
checkMockMessageHandler
(
Object
?
handler
)
{
bool
checkMockMessageHandler
(
Object
?
handler
)
{
return
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
name
,
handler
);
return
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
name
,
handler
);
}
}
}
}
...
@@ -92,7 +92,7 @@ extension TestMethodChannelExtension on MethodChannel {
...
@@ -92,7 +92,7 @@ extension TestMethodChannelExtension on MethodChannel {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
void
setMockMethodCallHandler
(
Future
<
dynamic
>?
Function
(
MethodCall
call
)?
handler
)
{
void
setMockMethodCallHandler
(
Future
<
dynamic
>?
Function
(
MethodCall
call
)?
handler
)
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
this
,
handler
);
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
this
,
handler
);
}
}
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
/// Shim for `TestDefaultBinaryMessenger.checkMockMessageHandler`.
...
@@ -104,6 +104,6 @@ extension TestMethodChannelExtension on MethodChannel {
...
@@ -104,6 +104,6 @@ extension TestMethodChannelExtension on MethodChannel {
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// 'This feature was deprecated after v2.1.0-10.0.pre.'
// )
// )
bool
checkMockMethodCallHandler
(
Object
?
handler
)
{
bool
checkMockMethodCallHandler
(
Object
?
handler
)
{
return
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
name
,
handler
);
return
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
name
,
handler
);
}
}
}
}
packages/flutter_test/lib/src/event_simulation.dart
View file @
07c548c6
...
@@ -680,7 +680,7 @@ class KeyEventSimulator {
...
@@ -680,7 +680,7 @@ class KeyEventSimulator {
static
Future
<
bool
>
_simulateKeyEventByRawEvent
(
ValueGetter
<
Map
<
String
,
dynamic
>>
buildKeyData
)
async
{
static
Future
<
bool
>
_simulateKeyEventByRawEvent
(
ValueGetter
<
Map
<
String
,
dynamic
>>
buildKeyData
)
async
{
return
TestAsyncUtils
.
guard
<
bool
>(()
async
{
return
TestAsyncUtils
.
guard
<
bool
>(()
async
{
final
Completer
<
bool
>
result
=
Completer
<
bool
>();
final
Completer
<
bool
>
result
=
Completer
<
bool
>();
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
keyEvent
.
name
,
SystemChannels
.
keyEvent
.
name
,
SystemChannels
.
keyEvent
.
codec
.
encodeMessage
(
buildKeyData
()),
SystemChannels
.
keyEvent
.
codec
.
encodeMessage
(
buildKeyData
()),
(
ByteData
?
data
)
{
(
ByteData
?
data
)
{
...
...
packages/flutter_test/lib/src/test_text_input.dart
View file @
07c548c6
...
@@ -205,7 +205,7 @@ class TestTextInput {
...
@@ -205,7 +205,7 @@ class TestTextInput {
/// * [enterText], which is similar but takes only a String and resets the
/// * [enterText], which is similar but takes only a String and resets the
/// selection.
/// selection.
void
updateEditingValue
(
TextEditingValue
value
)
{
void
updateEditingValue
(
TextEditingValue
value
)
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -229,7 +229,7 @@ class TestTextInput {
...
@@ -229,7 +229,7 @@ class TestTextInput {
Future
<
void
>
receiveAction
(
TextInputAction
action
)
async
{
Future
<
void
>
receiveAction
(
TextInputAction
action
)
async
{
return
TestAsyncUtils
.
guard
(()
{
return
TestAsyncUtils
.
guard
(()
{
final
Completer
<
void
>
completer
=
Completer
<
void
>();
final
Completer
<
void
>
completer
=
Completer
<
void
>();
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -269,7 +269,7 @@ class TestTextInput {
...
@@ -269,7 +269,7 @@ class TestTextInput {
/// example when using the [integration_test] library, there is a risk that
/// example when using the [integration_test] library, there is a risk that
/// the real IME will become confused as to the current state of input.
/// the real IME will become confused as to the current state of input.
void
closeConnection
()
{
void
closeConnection
()
{
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -284,7 +284,7 @@ class TestTextInput {
...
@@ -284,7 +284,7 @@ class TestTextInput {
/// Simulates a scribble interaction starting.
/// Simulates a scribble interaction starting.
Future
<
void
>
startScribbleInteraction
()
async
{
Future
<
void
>
startScribbleInteraction
()
async
{
assert
(
isRegistered
);
assert
(
isRegistered
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -299,7 +299,7 @@ class TestTextInput {
...
@@ -299,7 +299,7 @@ class TestTextInput {
/// Simulates a Scribble focus.
/// Simulates a Scribble focus.
Future
<
void
>
scribbleFocusElement
(
String
elementIdentifier
,
Offset
offset
)
async
{
Future
<
void
>
scribbleFocusElement
(
String
elementIdentifier
,
Offset
offset
)
async
{
assert
(
isRegistered
);
assert
(
isRegistered
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -315,7 +315,7 @@ class TestTextInput {
...
@@ -315,7 +315,7 @@ class TestTextInput {
Future
<
List
<
List
<
dynamic
>>>
scribbleRequestElementsInRect
(
Rect
rect
)
async
{
Future
<
List
<
List
<
dynamic
>>>
scribbleRequestElementsInRect
(
Rect
rect
)
async
{
assert
(
isRegistered
);
assert
(
isRegistered
);
List
<
List
<
dynamic
>>
response
=
<
List
<
dynamic
>>[];
List
<
List
<
dynamic
>>
response
=
<
List
<
dynamic
>>[];
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -334,7 +334,7 @@ class TestTextInput {
...
@@ -334,7 +334,7 @@ class TestTextInput {
/// Simulates iOS inserting a UITextPlaceholder during a long press with the pencil.
/// Simulates iOS inserting a UITextPlaceholder during a long press with the pencil.
Future
<
void
>
scribbleInsertPlaceholder
()
async
{
Future
<
void
>
scribbleInsertPlaceholder
()
async
{
assert
(
isRegistered
);
assert
(
isRegistered
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
@@ -349,7 +349,7 @@ class TestTextInput {
...
@@ -349,7 +349,7 @@ class TestTextInput {
/// Simulates iOS removing a UITextPlaceholder after a long press with the pencil is released.
/// Simulates iOS removing a UITextPlaceholder after a long press with the pencil is released.
Future
<
void
>
scribbleRemovePlaceholder
()
async
{
Future
<
void
>
scribbleRemovePlaceholder
()
async
{
assert
(
isRegistered
);
assert
(
isRegistered
);
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
.
handlePlatformMessage
(
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
MethodCall
(
MethodCall
(
...
...
packages/flutter_test/lib/src/test_text_input_key_handler.dart
View file @
07c548c6
...
@@ -26,7 +26,7 @@ class MacOSTestTextInputKeyHandler extends TestTextInputKeyHandler {
...
@@ -26,7 +26,7 @@ class MacOSTestTextInputKeyHandler extends TestTextInputKeyHandler {
final
int
client
;
final
int
client
;
Future
<
void
>
_sendSelectors
(
List
<
String
>
selectors
)
async
{
Future
<
void
>
_sendSelectors
(
List
<
String
>
selectors
)
async
{
await
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
await
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
.
handlePlatformMessage
(
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
name
,
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
SystemChannels
.
textInput
.
codec
.
encodeMethodCall
(
...
...
packages/flutter_test/test/widget_tester_test.dart
View file @
07c548c6
...
@@ -827,7 +827,7 @@ void main() {
...
@@ -827,7 +827,7 @@ void main() {
testWidgets
(
'Returns the list of announcements'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Returns the list of announcements'
,
(
WidgetTester
tester
)
async
{
// Make sure the handler is properly set
// Make sure the handler is properly set
expect
(
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
expect
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
),
isFalse
);
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
),
isFalse
);
await
SemanticsService
.
announce
(
'announcement 1'
,
TextDirection
.
ltr
);
await
SemanticsService
.
announce
(
'announcement 1'
,
TextDirection
.
ltr
);
...
@@ -863,7 +863,7 @@ void main() {
...
@@ -863,7 +863,7 @@ void main() {
log
.
add
(
message
);
log
.
add
(
message
);
}
}
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
handleMessage
);
SystemChannels
.
accessibility
,
handleMessage
);
...
@@ -883,14 +883,14 @@ void main() {
...
@@ -883,14 +883,14 @@ void main() {
]));
]));
// Remove the handler
// Remove the handler
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockDecodedMessageHandler
<
dynamic
>(
.
setMockDecodedMessageHandler
<
dynamic
>(
SystemChannels
.
accessibility
,
null
);
SystemChannels
.
accessibility
,
null
);
});
});
tearDown
(()
{
tearDown
(()
{
// Make sure that the handler is removed in [TestWidgetsFlutterBinding.postTest]
// Make sure that the handler is removed in [TestWidgetsFlutterBinding.postTest]
expect
(
TestDefaultBinaryMessengerBinding
.
instance
!
.
defaultBinaryMessenger
expect
(
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
),
isTrue
);
.
checkMockMessageHandler
(
SystemChannels
.
accessibility
.
name
,
null
),
isTrue
);
});
});
});
});
...
...
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