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
7d46d436
Unverified
Commit
7d46d436
authored
May 12, 2021
by
Alexandre Ardhuin
Committed by
GitHub
May 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use throwsXxx instead of throwsA(isA<Xxx>()) (#82328)
parent
ab2aa319
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
133 additions
and
154 deletions
+133
-154
bottom_tab_bar_test.dart
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
+1
-1
segmented_control_test.dart
packages/flutter/test/cupertino/segmented_control_test.dart
+3
-3
sliding_segmented_control_test.dart
...lutter/test/cupertino/sliding_segmented_control_test.dart
+3
-3
dropdown_form_field_test.dart
packages/flutter/test/material/dropdown_form_field_test.dart
+2
-2
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+2
-2
toggle_buttons_test.dart
packages/flutter/test/material/toggle_buttons_test.dart
+1
-1
box_test.dart
packages/flutter/test/rendering/box_test.dart
+2
-2
restoration_bucket_test.dart
packages/flutter/test/services/restoration_bucket_test.dart
+1
-1
grid_view_test.dart
packages/flutter/test/widgets/grid_view_test.dart
+1
-1
list_wheel_scroll_view_test.dart
...ges/flutter/test/widgets/list_wheel_scroll_view_test.dart
+1
-1
page_view_test.dart
packages/flutter/test/widgets/page_view_test.dart
+2
-2
flutter_driver_test.dart
...utter_driver/test/src/real_tests/flutter_driver_test.dart
+11
-20
io_extension_test.dart
...flutter_driver/test/src/real_tests/io_extension_test.dart
+1
-2
goldens_test.dart
packages/flutter_test/test/goldens_test.dart
+5
-5
build_test.dart
...lutter_tools/test/commands.shard/hermetic/build_test.dart
+2
-2
generate_localizations_test.dart
.../commands.shard/hermetic/generate_localizations_test.dart
+2
-2
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+4
-8
screenshot_command_test.dart
...test/commands.shard/hermetic/screenshot_command_test.dart
+2
-2
test_test.dart
...flutter_tools/test/commands.shard/hermetic/test_test.dart
+1
-2
android_device_port_forwarder_test.dart
...ral.shard/android/android_device_port_forwarder_test.dart
+2
-3
android_gradle_builder_test.dart
...st/general.shard/android/android_gradle_builder_test.dart
+2
-3
artifact_updater_test.dart
...utter_tools/test/general.shard/artifact_updater_test.dart
+3
-4
common_test.dart
...es/flutter_tools/test/general.shard/base/common_test.dart
+1
-1
error_handling_io_test.dart
...tools/test/general.shard/base/error_handling_io_test.dart
+5
-5
logger_test.dart
...es/flutter_tools/test/general.shard/base/logger_test.dart
+3
-3
os_test.dart
packages/flutter_tools/test/general.shard/base/os_test.dart
+1
-2
process_test.dart
...s/flutter_tools/test/general.shard/base/process_test.dart
+6
-8
assets_test.dart
.../test/general.shard/build_system/targets/assets_test.dart
+5
-6
common_test.dart
.../test/general.shard/build_system/targets/common_test.dart
+2
-4
desktop_test.dart
...test/general.shard/build_system/targets/desktop_test.dart
+2
-2
ios_test.dart
...ols/test/general.shard/build_system/targets/ios_test.dart
+30
-28
localizations_test.dart
...eneral.shard/build_system/targets/localizations_test.dart
+1
-1
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+14
-12
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+1
-1
device_test.dart
packages/flutter_tools/test/general.shard/device_test.dart
+1
-2
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+2
-2
mdns_discovery_test.dart
...flutter_tools/test/general.shard/mdns_discovery_test.dart
+1
-1
resident_web_runner_cold_test.dart
...ols/test/general.shard/resident_web_runner_cold_test.dart
+1
-1
flutter_command_test.dart
...tools/test/general.shard/runner/flutter_command_test.dart
+2
-2
testbed_test.dart
packages/flutter_tools/test/general.shard/testbed_test.dart
+1
-1
No files found.
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
View file @
7d46d436
...
@@ -39,7 +39,7 @@ Future<void> main() async {
...
@@ -39,7 +39,7 @@ Future<void> main() async {
),
),
],
],
)),
)),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'items.length'
),
contains
(
'items.length'
),
...
...
packages/flutter/test/cupertino/segmented_control_test.dart
View file @
7d46d436
...
@@ -94,7 +94,7 @@ void main() {
...
@@ -94,7 +94,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'children.length'
),
contains
(
'children.length'
),
...
@@ -110,7 +110,7 @@ void main() {
...
@@ -110,7 +110,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'children.length'
),
contains
(
'children.length'
),
...
@@ -220,7 +220,7 @@ void main() {
...
@@ -220,7 +220,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'children'
),
contains
(
'children'
),
...
...
packages/flutter/test/cupertino/sliding_segmented_control_test.dart
View file @
7d46d436
...
@@ -82,7 +82,7 @@ void main() {
...
@@ -82,7 +82,7 @@ void main() {
onValueChanged:
defaultCallback
,
onValueChanged:
defaultCallback
,
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'children.length'
),
contains
(
'children.length'
),
...
@@ -97,7 +97,7 @@ void main() {
...
@@ -97,7 +97,7 @@ void main() {
onValueChanged:
defaultCallback
,
onValueChanged:
defaultCallback
,
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'children.length'
),
contains
(
'children.length'
),
...
@@ -117,7 +117,7 @@ void main() {
...
@@ -117,7 +117,7 @@ void main() {
onValueChanged:
defaultCallback
,
onValueChanged:
defaultCallback
,
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
'groupValue must be either null or one of the keys in the children map'
),
contains
(
'groupValue must be either null or one of the keys in the children map'
),
...
...
packages/flutter/test/material/dropdown_form_field_test.dart
View file @
7d46d436
...
@@ -588,7 +588,7 @@ void main() {
...
@@ -588,7 +588,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
...
@@ -617,7 +617,7 @@ void main() {
...
@@ -617,7 +617,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
7d46d436
...
@@ -457,7 +457,7 @@ void main() {
...
@@ -457,7 +457,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
...
@@ -486,7 +486,7 @@ void main() {
...
@@ -486,7 +486,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
contains
(
"There should be exactly one item with [DropdownButton]'s value"
),
...
...
packages/flutter/test/material/toggle_buttons_test.dart
View file @
7d46d436
...
@@ -185,7 +185,7 @@ void main() {
...
@@ -185,7 +185,7 @@ void main() {
),
),
),
),
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
toString
(),
(
AssertionError
error
)
=>
error
.
toString
(),
'.toString()'
,
'.toString()'
,
allOf
(
allOf
(
...
...
packages/flutter/test/rendering/box_test.dart
View file @
7d46d436
...
@@ -980,7 +980,7 @@ void main() {
...
@@ -980,7 +980,7 @@ void main() {
},
},
);
);
},
},
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
message
,
(
AssertionError
error
)
=>
error
.
message
,
'message'
,
'message'
,
'paintTransform must be invertible.'
,
'paintTransform must be invertible.'
,
...
@@ -996,7 +996,7 @@ void main() {
...
@@ -996,7 +996,7 @@ void main() {
},
},
);
);
},
},
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
message
,
(
AssertionError
error
)
=>
error
.
message
,
'message'
,
'message'
,
'Exactly one transform or offset argument must be provided.'
,
'Exactly one transform or offset argument must be provided.'
,
...
...
packages/flutter/test/services/restoration_bucket_test.dart
View file @
7d46d436
...
@@ -183,7 +183,7 @@ void main() {
...
@@ -183,7 +183,7 @@ void main() {
// child1 is not given up before running finalizers.
// child1 is not given up before running finalizers.
expect
(
expect
(
()
=>
manager
.
doSerialization
(),
()
=>
manager
.
doSerialization
(),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
equals
(
equals
(
...
...
packages/flutter/test/widgets/grid_view_test.dart
View file @
7d46d436
...
@@ -768,7 +768,7 @@ void main() {
...
@@ -768,7 +768,7 @@ void main() {
child:
GridView
.
extent
(
child:
GridView
.
extent
(
maxCrossAxisExtent:
maxCrossAxisExtent
,
maxCrossAxisExtent:
maxCrossAxisExtent
,
),
),
),
throwsA
(
isA
<
AssertionError
>())
);
),
throwsA
ssertionError
);
});
});
}
}
packages/flutter/test/widgets/list_wheel_scroll_view_test.dart
View file @
7d46d436
...
@@ -56,7 +56,7 @@ void main() {
...
@@ -56,7 +56,7 @@ void main() {
itemExtent:
20.0
,
itemExtent:
20.0
,
children:
const
<
Widget
>[],
children:
const
<
Widget
>[],
),
),
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
message
,
(
AssertionError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
"You can't set a diameterRatio of 0"
),
contains
(
"You can't set a diameterRatio of 0"
),
...
...
packages/flutter/test/widgets/page_view_test.dart
View file @
7d46d436
...
@@ -758,7 +758,7 @@ void main() {
...
@@ -758,7 +758,7 @@ void main() {
final
PageController
controller
=
PageController
();
final
PageController
controller
=
PageController
();
expect
(
expect
(
()
=>
controller
.
page
,
()
=>
controller
.
page
,
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
message
,
(
AssertionError
error
)
=>
error
.
message
,
'message'
,
'message'
,
equals
(
'PageController.page cannot be accessed before a PageView is built with it.'
),
equals
(
'PageController.page cannot be accessed before a PageView is built with it.'
),
...
@@ -792,7 +792,7 @@ void main() {
...
@@ -792,7 +792,7 @@ void main() {
);
);
expect
(
expect
(
()
=>
controller
.
page
,
()
=>
controller
.
page
,
throwsA
(
isA
<
AssertionError
>()
.
having
(
throwsA
(
isA
ssertionError
.
having
(
(
AssertionError
error
)
=>
error
.
message
,
(
AssertionError
error
)
=>
error
.
message
,
'message'
,
'message'
,
equals
(
'PageController.page cannot be accessed before a PageView is built with it.'
),
equals
(
'PageController.page cannot be accessed before a PageView is built with it.'
),
...
...
packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart
View file @
7d46d436
...
@@ -632,11 +632,11 @@ void main() {
...
@@ -632,11 +632,11 @@ void main() {
group
(
'VMServiceFlutterDriver Unsupported error'
,
()
{
group
(
'VMServiceFlutterDriver Unsupported error'
,
()
{
test
(
'enableAccessibility'
,
()
async
{
test
(
'enableAccessibility'
,
()
async
{
expect
(
driver
.
enableAccessibility
(),
throws
A
(
isA
<
UnsupportedError
>())
);
expect
(
driver
.
enableAccessibility
(),
throws
UnsupportedError
);
});
});
test
(
'webDriver'
,
()
async
{
test
(
'webDriver'
,
()
async
{
expect
(()
=>
driver
.
webDriver
,
throws
A
(
isA
<
UnsupportedError
>())
);
expect
(()
=>
driver
.
webDriver
,
throws
UnsupportedError
);
});
});
});
});
});
});
...
@@ -913,28 +913,23 @@ void main() {
...
@@ -913,28 +913,23 @@ void main() {
group
(
'WebFlutterDriver Unimplemented/Unsupported error'
,
()
{
group
(
'WebFlutterDriver Unimplemented/Unsupported error'
,
()
{
test
(
'forceGC'
,
()
async
{
test
(
'forceGC'
,
()
async
{
expect
(
driver
.
forceGC
(),
expect
(
driver
.
forceGC
(),
throwsUnimplementedError
);
throwsA
(
isA
<
UnimplementedError
>()));
});
});
test
(
'getVmFlags'
,
()
async
{
test
(
'getVmFlags'
,
()
async
{
expect
(
driver
.
getVmFlags
(),
expect
(
driver
.
getVmFlags
(),
throwsUnimplementedError
);
throwsA
(
isA
<
UnimplementedError
>()));
});
});
test
(
'waitUntilFirstFrameRasterized'
,
()
async
{
test
(
'waitUntilFirstFrameRasterized'
,
()
async
{
expect
(
driver
.
waitUntilFirstFrameRasterized
(),
expect
(
driver
.
waitUntilFirstFrameRasterized
(),
throwsUnimplementedError
);
throwsA
(
isA
<
UnimplementedError
>()));
});
});
test
(
'appIsoloate'
,
()
async
{
test
(
'appIsoloate'
,
()
async
{
expect
(()
=>
driver
.
appIsolate
.
extensionRPCs
,
expect
(()
=>
driver
.
appIsolate
.
extensionRPCs
,
throwsUnsupportedError
);
throwsA
(
isA
<
UnsupportedError
>()));
});
});
test
(
'serviceClient'
,
()
async
{
test
(
'serviceClient'
,
()
async
{
expect
(()
=>
driver
.
serviceClient
.
getVM
(),
expect
(()
=>
driver
.
serviceClient
.
getVM
(),
throwsUnsupportedError
);
throwsA
(
isA
<
UnsupportedError
>()));
});
});
});
});
});
});
...
@@ -949,14 +944,10 @@ void main() {
...
@@ -949,14 +944,10 @@ void main() {
});
});
test
(
'tracing'
,
()
async
{
test
(
'tracing'
,
()
async
{
expect
(
driver
.
traceAction
(()
async
{
return
Future
<
dynamic
>.
value
();
}),
expect
(
driver
.
traceAction
(()
async
{
return
Future
<
dynamic
>.
value
();
}),
throwsUnsupportedError
);
throwsA
(
isA
<
UnsupportedError
>()));
expect
(
driver
.
startTracing
(),
throwsUnsupportedError
);
expect
(
driver
.
startTracing
(),
expect
(
driver
.
stopTracingAndDownloadTimeline
(),
throwsUnsupportedError
);
throwsA
(
isA
<
UnsupportedError
>()));
expect
(
driver
.
clearTimeline
(),
throwsUnsupportedError
);
expect
(
driver
.
stopTracingAndDownloadTimeline
(),
throwsA
(
isA
<
UnsupportedError
>()));
expect
(
driver
.
clearTimeline
(),
throwsA
(
isA
<
UnsupportedError
>()));
});
});
});
});
}
}
...
...
packages/flutter_driver/test/src/real_tests/io_extension_test.dart
View file @
7d46d436
...
@@ -17,8 +17,7 @@ void main() {
...
@@ -17,8 +17,7 @@ void main() {
});
});
test
(
'io_extension should throw exception'
,
()
{
test
(
'io_extension should throw exception'
,
()
{
expect
(()
=>
registerWebServiceExtension
(
call
),
expect
(()
=>
registerWebServiceExtension
(
call
),
throwsUnsupportedError
);
throwsA
(
isA
<
UnsupportedError
>()));
});
});
});
});
}
}
packages/flutter_test/test/goldens_test.dart
View file @
7d46d436
...
@@ -185,7 +185,7 @@ void main() {
...
@@ -185,7 +185,7 @@ void main() {
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kColorFailurePngBytes
);
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kColorFailurePngBytes
);
await
expectLater
(
await
expectLater
(
()
=>
doComparison
(),
()
=>
doComparison
(),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
'% diff detected'
),
contains
(
'% diff detected'
),
...
@@ -216,7 +216,7 @@ void main() {
...
@@ -216,7 +216,7 @@ void main() {
..
writeAsBytesSync
(
_kColorFailurePngBytes
);
..
writeAsBytesSync
(
_kColorFailurePngBytes
);
await
expectLater
(
await
expectLater
(
()
=>
doComparison
(
'subdir/golden.png'
),
()
=>
doComparison
(
'subdir/golden.png'
),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
'% diff detected'
),
contains
(
'% diff detected'
),
...
@@ -255,7 +255,7 @@ void main() {
...
@@ -255,7 +255,7 @@ void main() {
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kSizeFailurePngBytes
);
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kSizeFailurePngBytes
);
await
expectLater
(
await
expectLater
(
()
=>
doComparison
(),
()
=>
doComparison
(),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
'image sizes do not match'
),
contains
(
'image sizes do not match'
),
...
@@ -267,7 +267,7 @@ void main() {
...
@@ -267,7 +267,7 @@ void main() {
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kColorFailurePngBytes
);
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(
_kColorFailurePngBytes
);
await
expectLater
(
await
expectLater
(
()
=>
doComparison
(),
()
=>
doComparison
(),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
'% diff detected'
),
contains
(
'% diff detected'
),
...
@@ -279,7 +279,7 @@ void main() {
...
@@ -279,7 +279,7 @@ void main() {
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(<
int
>[]);
await
fs
.
file
(
fix
(
'/golden.png'
)).
writeAsBytes
(<
int
>[]);
await
expectLater
(
await
expectLater
(
()
=>
doComparison
(),
()
=>
doComparison
(),
throwsA
(
is
A
<
FlutterError
>()
.
having
(
throwsA
(
is
FlutterError
.
having
(
(
FlutterError
error
)
=>
error
.
message
,
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
'message'
,
contains
(
'null image provided'
),
contains
(
'null image provided'
),
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_test.dart
View file @
7d46d436
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
// @dart = 2.8
// @dart = 2.8
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
...
@@ -19,7 +19,7 @@ void main() {
...
@@ -19,7 +19,7 @@ void main() {
expect
(()
=>
commandRunner
.
run
(<
String
>[
expect
(()
=>
commandRunner
.
run
(<
String
>[
'build'
,
'build'
,
'--obfuscate'
,
'--obfuscate'
,
]),
throws
A
(
isA
<
ToolExit
>()
));
]),
throws
ToolExit
(
));
});
});
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart
View file @
7d46d436
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
// @dart = 2.8
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/commands/generate_localizations.dart'
;
import
'package:flutter_tools/src/commands/generate_localizations.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'../../integration.shard/test_data/basic_project.dart'
;
import
'../../integration.shard/test_data/basic_project.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
...
@@ -100,7 +100,7 @@ void main() {
...
@@ -100,7 +100,7 @@ void main() {
'--header="some header'
,
'--header="some header'
,
'--header-file="header.txt"'
,
'--header-file="header.txt"'
,
]),
]),
throws
A
(
isA
<
ToolExit
>()
),
throws
ToolExit
(
),
);
);
});
});
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
7d46d436
...
@@ -75,7 +75,7 @@ void main() {
...
@@ -75,7 +75,7 @@ void main() {
'--no-pub'
,
'--no-pub'
,
'--show-test-device'
,
'--show-test-device'
,
]),
]),
throwsA
(
is
A
<
Exception
>()
.
having
(
throwsA
(
is
Exception
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'toString'
,
'toString'
,
isNot
(
contains
(
'--fast-start is not supported with --use-application-binary'
)),
isNot
(
contains
(
'--fast-start is not supported with --use-application-binary'
)),
...
@@ -102,7 +102,7 @@ void main() {
...
@@ -102,7 +102,7 @@ void main() {
'run'
,
'run'
,
'--no-pub'
,
'--no-pub'
,
]),
]),
throws
A
(
isA
<
ToolExit
>()
),
throws
ToolExit
(
),
);
);
final
BufferLogger
bufferLogger
=
globals
.
logger
as
BufferLogger
;
final
BufferLogger
bufferLogger
=
globals
.
logger
as
BufferLogger
;
expect
(
expect
(
...
@@ -127,11 +127,7 @@ void main() {
...
@@ -127,11 +127,7 @@ void main() {
'run'
,
'run'
,
'--no-pub'
,
'--no-pub'
,
]),
]),
throwsA
(
isA
<
ToolExit
>().
having
(
throwsToolExit
(
message:
'No pubspec.yaml file found'
),
(
ToolExit
error
)
=>
error
.
toString
(),
'toString()'
,
contains
(
'No pubspec.yaml file found'
),
)),
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
...
@@ -510,7 +506,7 @@ void main() {
...
@@ -510,7 +506,7 @@ void main() {
'run'
,
'run'
,
'--no-pub'
,
'--no-pub'
,
'--bundle-sksl-path=foo.json'
,
'--bundle-sksl-path=foo.json'
,
]),
throws
A
(
isA
<
ToolExit
>().
having
((
ToolExit
exit
)
=>
exit
.
message
,
'message'
,
contains
(
'No SkSL shader bundle found at foo.json'
))
));
]),
throws
ToolExit
(
message:
'No SkSL shader bundle found at foo.json'
));
});
});
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart
View file @
7d46d436
...
@@ -30,12 +30,12 @@ void main() {
...
@@ -30,12 +30,12 @@ void main() {
await
expectLater
(()
=>
createTestCommandRunner
(
ScreenshotCommand
())
await
expectLater
(()
=>
createTestCommandRunner
(
ScreenshotCommand
())
.
run
(<
String
>[
'screenshot'
,
'--type=skia'
,
'--observatory-url=http://localhost:8181'
]),
.
run
(<
String
>[
'screenshot'
,
'--type=skia'
,
'--observatory-url=http://localhost:8181'
]),
throwsA
(
is
A
<
Exception
>().
having
((
dynamic
exception
)
=>
exception
.
toString
(),
'message'
,
contains
(
'dummy'
))),
throwsA
(
is
Exception
.
having
((
Exception
exception
)
=>
exception
.
toString
(),
'message'
,
contains
(
'dummy'
))),
);
);
await
expectLater
(()
=>
createTestCommandRunner
(
ScreenshotCommand
())
await
expectLater
(()
=>
createTestCommandRunner
(
ScreenshotCommand
())
.
run
(<
String
>[
'screenshot'
,
'--type=rasterizer'
,
'--observatory-url=http://localhost:8181'
]),
.
run
(<
String
>[
'screenshot'
,
'--type=rasterizer'
,
'--observatory-url=http://localhost:8181'
]),
throwsA
(
is
A
<
Exception
>().
having
((
dynamic
exception
)
=>
exception
.
toString
(),
'message'
,
contains
(
'dummy'
))),
throwsA
(
is
Exception
.
having
((
Exception
exception
)
=>
exception
.
toString
(),
'message'
,
contains
(
'dummy'
))),
);
);
});
});
...
...
packages/flutter_tools/test/commands.shard/hermetic/test_test.dart
View file @
7d46d436
...
@@ -211,8 +211,7 @@ dev_dependencies:
...
@@ -211,8 +211,7 @@ dev_dependencies:
'--coverage'
,
'--coverage'
,
'--'
,
'--'
,
'test/fake_test.dart'
,
'test/fake_test.dart'
,
]),
throwsA
(
isA
<
ToolExit
>()
]),
throwsA
(
isA
<
ToolExit
>().
having
((
ToolExit
toolExit
)
=>
toolExit
.
message
,
'message'
,
isNull
)));
.
having
((
ToolExit
toolExit
)
=>
toolExit
.
message
,
'message'
,
isNull
)));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart
View file @
7d46d436
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
// @dart = 2.8
// @dart = 2.8
import
'package:flutter_tools/src/android/android_device.dart'
;
import
'package:flutter_tools/src/android/android_device.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/device_port_forwarder.dart'
;
import
'package:flutter_tools/src/device_port_forwarder.dart'
;
...
@@ -78,7 +77,7 @@ void main() {
...
@@ -78,7 +77,7 @@ void main() {
logger:
BufferLogger
.
test
(),
logger:
BufferLogger
.
test
(),
);
);
expect
(
forwarder
.
forward
(
123
,
hostPort:
456
),
throws
A
(
isA
<
ProcessException
>()
));
expect
(
forwarder
.
forward
(
123
,
hostPort:
456
),
throws
ProcessException
(
));
});
});
testWithoutContext
(
'AndroidDevicePortForwarder forwardedPorts returns empty '
testWithoutContext
(
'AndroidDevicePortForwarder forwardedPorts returns empty '
...
@@ -159,6 +158,6 @@ void main() {
...
@@ -159,6 +158,6 @@ void main() {
logger:
BufferLogger
.
test
(),
logger:
BufferLogger
.
test
(),
);
);
expect
(()
=>
forwarder
.
unforward
(
ForwardedPort
(
456
,
23
)),
throws
A
(
isA
<
ProcessException
>()
));
expect
(()
=>
forwarder
.
unforward
(
ForwardedPort
(
456
,
23
)),
throws
ProcessException
(
));
});
});
}
}
packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
View file @
7d46d436
...
@@ -371,8 +371,7 @@ void main() {
...
@@ -371,8 +371,7 @@ void main() {
isBuildingBundle:
false
,
isBuildingBundle:
false
,
localGradleErrors:
const
<
GradleHandledError
>[],
localGradleErrors:
const
<
GradleHandledError
>[],
);
);
},
},
throwsProcessException
());
throwsA
(
isA
<
ProcessException
>()));
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
processManager
,
hasNoRemainingExpectations
);
});
});
...
...
packages/flutter_tools/test/general.shard/artifact_updater_test.dart
View file @
7d46d436
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
@@ -288,7 +287,7 @@ void main() {
...
@@ -288,7 +287,7 @@ void main() {
'test message'
,
'test message'
,
Uri
.
parse
(
'http://test.zip'
),
Uri
.
parse
(
'http://test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throwsA
(
isA
<
ArgumentError
>())
);
),
throwsA
rgumentError
);
expect
(
logger
.
statusText
,
contains
(
'test message'
));
expect
(
logger
.
statusText
,
contains
(
'test message'
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
...
@@ -361,7 +360,7 @@ void main() {
...
@@ -361,7 +360,7 @@ void main() {
'test message'
,
'test message'
,
Uri
.
parse
(
'http://test.zip'
),
Uri
.
parse
(
'http://test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throws
A
(
isA
<
ToolExit
>()
));
),
throws
ToolExit
(
));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
});
...
@@ -385,7 +384,7 @@ void main() {
...
@@ -385,7 +384,7 @@ void main() {
'test message'
,
'test message'
,
Uri
.
parse
(
'http://test.zip'
),
Uri
.
parse
(
'http://test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throws
A
(
isA
<
ToolExit
>()
));
),
throws
ToolExit
(
));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
});
...
...
packages/flutter_tools/test/general.shard/base/common_test.dart
View file @
7d46d436
...
@@ -26,7 +26,7 @@ void main() {
...
@@ -26,7 +26,7 @@ void main() {
});
});
testWithoutContext
(
'Throws if accessing the Zone'
,
()
{
testWithoutContext
(
'Throws if accessing the Zone'
,
()
{
expect
(()
=>
context
.
get
<
Object
>(),
throws
A
(
isA
<
UnsupportedError
>())
);
expect
(()
=>
context
.
get
<
Object
>(),
throws
UnsupportedError
);
});
});
});
});
}
}
packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart
View file @
7d46d436
...
@@ -168,7 +168,7 @@ void main() {
...
@@ -168,7 +168,7 @@ void main() {
when
(
file
.
deleteSync
(
recursive:
false
))
when
(
file
.
deleteSync
(
recursive:
false
))
.
thenThrow
(
const
FileSystemException
(
''
,
''
,
OSError
(
''
,
2
)));
.
thenThrow
(
const
FileSystemException
(
''
,
''
,
OSError
(
''
,
2
)));
expect
(()
=>
ErrorHandlingFileSystem
.
deleteIfExists
(
file
),
throws
A
(
isA
<
ToolExit
>()
));
expect
(()
=>
ErrorHandlingFileSystem
.
deleteIfExists
(
file
),
throws
ToolExit
(
));
});
});
testWithoutContext
(
'deleteIfExists does not tool exit if file exists on read-only '
testWithoutContext
(
'deleteIfExists does not tool exit if file exists on read-only '
...
@@ -182,7 +182,7 @@ void main() {
...
@@ -182,7 +182,7 @@ void main() {
ErrorHandlingFileSystem
.
noExitOnFailure
(()
{
ErrorHandlingFileSystem
.
noExitOnFailure
(()
{
ErrorHandlingFileSystem
.
deleteIfExists
(
file
);
ErrorHandlingFileSystem
.
deleteIfExists
(
file
);
});
});
},
throws
A
(
isA
<
FileSystemException
>()
));
},
throws
FileSystemException
(
));
});
});
group
(
'throws ToolExit on Windows'
,
()
{
group
(
'throws ToolExit on Windows'
,
()
{
...
@@ -213,7 +213,7 @@ void main() {
...
@@ -213,7 +213,7 @@ void main() {
final
File
file
=
fs
.
file
(
'file'
);
final
File
file
=
fs
.
file
(
'file'
);
expect
(()
=>
ErrorHandlingFileSystem
.
noExitOnFailure
(
expect
(()
=>
ErrorHandlingFileSystem
.
noExitOnFailure
(
()
=>
file
.
writeAsStringSync
(
''
)),
throws
A
(
isA
<
Exception
>())
);
()
=>
file
.
writeAsStringSync
(
''
)),
throws
Exception
);
// nesting does not unconditionally re-enable errors.
// nesting does not unconditionally re-enable errors.
expect
(()
{
expect
(()
{
...
@@ -221,10 +221,10 @@ void main() {
...
@@ -221,10 +221,10 @@ void main() {
ErrorHandlingFileSystem
.
noExitOnFailure
(()
{
});
ErrorHandlingFileSystem
.
noExitOnFailure
(()
{
});
file
.
writeAsStringSync
(
''
);
file
.
writeAsStringSync
(
''
);
});
});
},
throws
A
(
isA
<
Exception
>())
);
},
throws
Exception
);
// Check that state does not leak.
// Check that state does not leak.
expect
(()
=>
file
.
writeAsStringSync
(
''
),
throws
A
(
isA
<
ToolExit
>()
));
expect
(()
=>
file
.
writeAsStringSync
(
''
),
throws
ToolExit
(
));
});
});
testWithoutContext
(
'when access is denied'
,
()
async
{
testWithoutContext
(
'when access is denied'
,
()
async
{
...
...
packages/flutter_tools/test/general.shard/base/logger_test.dart
View file @
7d46d436
...
@@ -227,7 +227,7 @@ void main() {
...
@@ -227,7 +227,7 @@ void main() {
expect
(
expect
(
()
=>
asLogger
<
AppRunLogger
>(
notifyingLogger
),
()
=>
asLogger
<
AppRunLogger
>(
notifyingLogger
),
throws
A
(
isA
<
StateError
>())
,
throws
StateError
,
);
);
});
});
...
@@ -335,8 +335,8 @@ void main() {
...
@@ -335,8 +335,8 @@ void main() {
logger
.
printStatus
(
'message'
);
logger
.
printStatus
(
'message'
);
logger
.
printError
(
'error message'
);
logger
.
printError
(
'error message'
);
expect
(()
async
=>
stdout
.
done
,
throws
A
(
isA
<
Exception
>())
);
expect
(()
async
=>
stdout
.
done
,
throws
Exception
);
expect
(()
async
=>
stderr
.
done
,
throws
A
(
isA
<
Exception
>())
);
expect
(()
async
=>
stderr
.
done
,
throws
Exception
);
});
});
group
(
'Spinners'
,
()
{
group
(
'Spinners'
,
()
{
...
...
packages/flutter_tools/test/general.shard/base/os_test.dart
View file @
7d46d436
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
...
@@ -100,7 +99,7 @@ void main() {
...
@@ -100,7 +99,7 @@ void main() {
processManager:
fakeProcessManager
,
processManager:
fakeProcessManager
,
);
);
expect
(()
=>
utils
.
which
(
kExecutable
),
throws
A
(
isA
<
ToolExit
>()
));
expect
(()
=>
utils
.
which
(
kExecutable
),
throws
ToolExit
(
));
});
});
testWithoutContext
(
'returns null when executable does not exist'
,
()
async
{
testWithoutContext
(
'returns null when executable does not exist'
,
()
async
{
...
...
packages/flutter_tools/test/general.shard/base/process_test.dart
View file @
7d46d436
...
@@ -35,8 +35,7 @@ void main() {
...
@@ -35,8 +35,7 @@ void main() {
exitCode:
1
,
exitCode:
1
,
));
));
expect
(()
async
=>
processUtils
.
run
(<
String
>[
'false'
],
throwOnError:
true
),
expect
(()
async
=>
processUtils
.
run
(<
String
>[
'false'
],
throwOnError:
true
),
throwsProcessException
());
throwsA
(
isA
<
ProcessException
>()));
});
});
});
});
...
@@ -124,8 +123,7 @@ void main() {
...
@@ -124,8 +123,7 @@ void main() {
],
],
exitCode:
1
,
exitCode:
1
,
));
));
expect
(()
=>
processUtils
.
run
(<
String
>[
'kaboom'
],
throwOnError:
true
),
expect
(()
=>
processUtils
.
run
(<
String
>[
'kaboom'
],
throwOnError:
true
),
throwsProcessException
());
throwsA
(
isA
<
ProcessException
>()));
});
});
testWithoutContext
(
' does not throw on allowed Failures'
,
()
async
{
testWithoutContext
(
' does not throw on allowed Failures'
,
()
async
{
...
@@ -158,7 +156,7 @@ void main() {
...
@@ -158,7 +156,7 @@ void main() {
throwOnError:
true
,
throwOnError:
true
,
allowedFailures:
(
int
c
)
=>
c
==
1
,
allowedFailures:
(
int
c
)
=>
c
==
1
,
),
),
throws
A
(
isA
<
ProcessException
>()
),
throws
ProcessException
(
),
);
);
});
});
});
});
...
@@ -269,7 +267,8 @@ void main() {
...
@@ -269,7 +267,8 @@ void main() {
throwOnError:
true
,
throwOnError:
true
,
allowedFailures:
(
int
c
)
=>
c
==
1
,
allowedFailures:
(
int
c
)
=>
c
==
1
,
),
),
throwsA
(
isA
<
ProcessException
>()));
throwsProcessException
(),
);
});
});
testWithoutContext
(
' prints stdout and stderr to trace on success'
,
()
async
{
testWithoutContext
(
' prints stdout and stderr to trace on success'
,
()
async
{
...
@@ -294,8 +293,7 @@ void main() {
...
@@ -294,8 +293,7 @@ void main() {
stdout:
'stdout'
,
stdout:
'stdout'
,
stderr:
'stderr'
,
stderr:
'stderr'
,
));
));
expect
(()
=>
processUtils
.
runSync
(<
String
>[
'kaboom'
],
throwOnError:
true
),
expect
(()
=>
processUtils
.
runSync
(<
String
>[
'kaboom'
],
throwOnError:
true
),
throwsProcessException
());
throwsA
(
isA
<
ProcessException
>()));
expect
(
testLogger
.
statusText
,
contains
(
'stdout'
));
expect
(
testLogger
.
statusText
,
contains
(
'stdout'
));
expect
(
testLogger
.
errorText
,
contains
(
'stderr'
));
expect
(
testLogger
.
errorText
,
contains
(
'stderr'
));
});
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart
View file @
7d46d436
...
@@ -110,8 +110,7 @@ flutter:
...
@@ -110,8 +110,7 @@ flutter:
'''
);
'''
);
expect
(()
async
=>
const
CopyAssets
().
build
(
environment
),
expect
(()
async
=>
const
CopyAssets
().
build
(
environment
),
throwsException
);
throwsA
(
isA
<
Exception
>()));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -138,7 +137,7 @@ flutter:
...
@@ -138,7 +137,7 @@ flutter:
fileSystem:
MemoryFileSystem
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
logger:
BufferLogger
.
test
(),
logger:
BufferLogger
.
test
(),
engineVersion:
null
,
engineVersion:
null
,
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
});
});
testWithoutContext
(
'processSkSLBundle throws exception if the bundle is not '
testWithoutContext
(
'processSkSLBundle throws exception if the bundle is not '
...
@@ -154,7 +153,7 @@ flutter:
...
@@ -154,7 +153,7 @@ flutter:
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
logger:
logger
,
logger:
logger
,
engineVersion:
null
,
engineVersion:
null
,
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
expect
(
logger
.
errorText
,
contains
(
'was not a JSON object'
));
expect
(
logger
.
errorText
,
contains
(
'was not a JSON object'
));
});
});
...
@@ -171,7 +170,7 @@ flutter:
...
@@ -171,7 +170,7 @@ flutter:
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
logger:
logger
,
logger:
logger
,
engineVersion:
null
,
engineVersion:
null
,
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
expect
(
logger
.
errorText
,
contains
(
'was not a JSON object'
));
expect
(
logger
.
errorText
,
contains
(
'was not a JSON object'
));
});
});
...
@@ -192,7 +191,7 @@ flutter:
...
@@ -192,7 +191,7 @@ flutter:
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
logger:
logger
,
logger:
logger
,
engineVersion:
'2'
,
engineVersion:
'2'
,
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
expect
(
logger
.
errorText
,
contains
(
'Expected Flutter 1, but found 2'
));
expect
(
logger
.
errorText
,
contains
(
'Expected Flutter 1, but found 2'
));
});
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart
View file @
7d46d436
...
@@ -104,8 +104,7 @@ void main() {
...
@@ -104,8 +104,7 @@ void main() {
],
exitCode:
1
),
],
exitCode:
1
),
]);
]);
await
expectLater
(()
=>
const
KernelSnapshot
().
build
(
androidEnvironment
),
await
expectLater
(()
=>
const
KernelSnapshot
().
build
(
androidEnvironment
),
throwsException
);
throwsA
(
isA
<
Exception
>()));
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
processManager
,
hasNoRemainingExpectations
);
});
});
...
@@ -434,8 +433,7 @@ void main() {
...
@@ -434,8 +433,7 @@ void main() {
});
});
testUsingContext
(
'AotAssemblyProfile throws error if built for non-iOS platform'
,
()
async
{
testUsingContext
(
'AotAssemblyProfile throws error if built for non-iOS platform'
,
()
async
{
expect
(
const
AotAssemblyProfile
().
build
(
androidEnvironment
),
expect
(
const
AotAssemblyProfile
().
build
(
androidEnvironment
),
throwsException
);
throwsA
(
isA
<
Exception
>()));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
macPlatform
,
Platform:
()
=>
macPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/desktop_test.dart
View file @
7d46d436
...
@@ -64,7 +64,7 @@ void main() {
...
@@ -64,7 +64,7 @@ void main() {
'a.txt'
,
'a.txt'
,
],
],
clientSourcePaths:
<
String
>[
'foo'
],
clientSourcePaths:
<
String
>[
'foo'
],
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
});
});
testWithoutContext
(
'unpackDesktopArtifacts throws when attempting to copy missing directory'
,
()
async
{
testWithoutContext
(
'unpackDesktopArtifacts throws when attempting to copy missing directory'
,
()
async
{
...
@@ -79,7 +79,7 @@ void main() {
...
@@ -79,7 +79,7 @@ void main() {
'a.txt'
,
'a.txt'
,
],
],
clientSourcePaths:
<
String
>[
'foo'
],
clientSourcePaths:
<
String
>[
'foo'
],
),
throws
A
(
isA
<
Exception
>())
);
),
throws
Exception
);
});
});
testWithoutContext
(
'unpackDesktopArtifacts does not require a client source path'
,
()
async
{
testWithoutContext
(
'unpackDesktopArtifacts does not require a client source path'
,
()
async
{
...
...
packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart
View file @
7d46d436
...
@@ -225,7 +225,7 @@ void main() {
...
@@ -225,7 +225,7 @@ void main() {
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
);
);
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
is
A
<
Exception
>()
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
is
Exception
.
having
(
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
...
@@ -254,13 +254,11 @@ void main() {
...
@@ -254,13 +254,11 @@ void main() {
environment
.
defines
[
kBuildMode
]
=
'release'
;
environment
.
defines
[
kBuildMode
]
=
'release'
;
environment
.
defines
[
kIosArchs
]
=
'x86_64'
;
environment
.
defines
[
kIosArchs
]
=
'x86_64'
;
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
isException
.
having
(
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'required define SdkRoot but it was not provided'
),
contains
(
'required define SdkRoot but it was not provided'
),
)
)));
));
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
...
@@ -371,7 +369,7 @@ void main() {
...
@@ -371,7 +369,7 @@ void main() {
processManager
.
addCommand
(
copyPhysicalFrameworkCommand
);
processManager
.
addCommand
(
copyPhysicalFrameworkCommand
);
await
expectLater
(
await
expectLater
(
const
DebugUnpackIOS
().
build
(
environment
),
const
DebugUnpackIOS
().
build
(
environment
),
throwsA
(
is
A
<
Exception
>()
.
having
(
throwsA
(
is
Exception
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'Flutter.framework/Flutter does not exist, cannot thin'
),
contains
(
'Flutter.framework/Flutter does not exist, cannot thin'
),
...
@@ -413,11 +411,12 @@ void main() {
...
@@ -413,11 +411,12 @@ void main() {
await
expectLater
(
await
expectLater
(
const
DebugUnpackIOS
().
build
(
environment
),
const
DebugUnpackIOS
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
throwsA
(
isException
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'does not contain arm64 armv7. Running lipo -info:
\n
Architectures in the fat file:'
),
contains
(
'does not contain arm64 armv7. Running lipo -info:
\n
Architectures in the fat file:'
),
)));
)),
);
});
});
testWithoutContext
(
'fails when lipo extract fails'
,
()
async
{
testWithoutContext
(
'fails when lipo extract fails'
,
()
async
{
...
@@ -466,11 +465,12 @@ void main() {
...
@@ -466,11 +465,12 @@ void main() {
await
expectLater
(
await
expectLater
(
const
DebugUnpackIOS
().
build
(
environment
),
const
DebugUnpackIOS
().
build
(
environment
),
throwsA
(
is
A
<
Exception
>()
.
having
(
throwsA
(
is
Exception
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'Failed to extract arm64 armv7 for output/Flutter.framework/Flutter.
\n
lipo error
\n
Running lipo -info:
\n
Architectures in the fat file:'
),
contains
(
'Failed to extract arm64 armv7 for output/Flutter.framework/Flutter.
\n
lipo error
\n
Running lipo -info:
\n
Architectures in the fat file:'
),
)));
)),
);
});
});
testWithoutContext
(
'skips thin framework'
,
()
async
{
testWithoutContext
(
'skips thin framework'
,
()
async
{
...
@@ -582,11 +582,12 @@ void main() {
...
@@ -582,11 +582,12 @@ void main() {
await
expectLater
(
await
expectLater
(
const
DebugUnpackIOS
().
build
(
environment
),
const
DebugUnpackIOS
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
throwsA
(
isException
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'Failed to strip bitcode for output/Flutter.framework/Flutter.
\n
bitcode_strip error'
),
contains
(
'Failed to strip bitcode for output/Flutter.framework/Flutter.
\n
bitcode_strip error'
),
)));
)),
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
});
});
...
@@ -654,11 +655,12 @@ void main() {
...
@@ -654,11 +655,12 @@ void main() {
await
expectLater
(
await
expectLater
(
const
DebugUnpackIOS
().
build
(
environment
),
const
DebugUnpackIOS
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
throwsA
(
isException
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'Failed to codesign output/Flutter.framework/Flutter with identity ABC123.
\n
codesign error'
),
contains
(
'Failed to codesign output/Flutter.framework/Flutter with identity ABC123.
\n
codesign error'
),
)));
)),
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
});
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/localizations_test.dart
View file @
7d46d436
...
@@ -96,7 +96,7 @@ use-deferred-loading: string
...
@@ -96,7 +96,7 @@ use-deferred-loading: string
file:
configFile
,
file:
configFile
,
logger:
BufferLogger
.
test
(),
logger:
BufferLogger
.
test
(),
),
),
throws
A
(
isA
<
Exception
>())
,
throws
Exception
,
);
);
});
});
}
}
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
7d46d436
...
@@ -106,11 +106,12 @@ void main() {
...
@@ -106,11 +106,12 @@ void main() {
processManager
.
addCommand
(
copyFrameworkCommand
);
processManager
.
addCommand
(
copyFrameworkCommand
);
await
expectLater
(
await
expectLater
(
const
DebugUnpackMacOS
().
build
(
environment
),
const
DebugUnpackMacOS
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
throwsA
(
isException
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'FlutterMacOS.framework/FlutterMacOS does not exist, cannot thin'
),
contains
(
'FlutterMacOS.framework/FlutterMacOS does not exist, cannot thin'
),
)));
)),
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
...
@@ -133,11 +134,12 @@ void main() {
...
@@ -133,11 +134,12 @@ void main() {
await
expectLater
(
await
expectLater
(
const
DebugUnpackMacOS
().
build
(
environment
),
const
DebugUnpackMacOS
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
throwsA
(
isException
.
having
(
(
Exception
exception
)
=>
exception
.
toString
(),
(
Exception
exception
)
=>
exception
.
toString
(),
'description'
,
'description'
,
contains
(
'does not contain arm64 x86_64. Running lipo -info:
\n
Architectures in the fat file:'
),
contains
(
'does not contain arm64 x86_64. Running lipo -info:
\n
Architectures in the fat file:'
),
)));
)),
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
7d46d436
...
@@ -290,7 +290,7 @@ void main() {
...
@@ -290,7 +290,7 @@ void main() {
);
);
await
expectLater
(
await
expectLater
(
()
=>
cache
.
updateAll
(<
DevelopmentArtifact
>{
null
}),
()
=>
cache
.
updateAll
(<
DevelopmentArtifact
>{
null
}),
throws
A
(
isA
<
Exception
>())
,
throws
Exception
,
);
);
verify
(
artifact1
.
update
(
any
,
any
,
any
,
any
));
verify
(
artifact1
.
update
(
any
,
any
,
any
,
any
));
// Don't continue when retrieval fails.
// Don't continue when retrieval fails.
...
...
packages/flutter_tools/test/general.shard/device_test.dart
View file @
7d46d436
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
'dart:async'
;
import
'dart:async'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
...
@@ -336,7 +335,7 @@ void main() {
...
@@ -336,7 +335,7 @@ void main() {
);
);
await
expectLater
(
await
expectLater
(
()
async
=>
deviceManager
.
findTargetDevices
(
FakeFlutterProject
()),
()
async
=>
deviceManager
.
findTargetDevices
(
FakeFlutterProject
()),
throws
A
(
isA
<
ToolExit
>())
throws
ToolExit
(),
);
);
});
});
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
7d46d436
...
@@ -517,7 +517,7 @@ void main() {
...
@@ -517,7 +517,7 @@ void main() {
when
(
mockXcdevice
.
isInstalled
).
thenReturn
(
false
);
when
(
mockXcdevice
.
isInstalled
).
thenReturn
(
false
);
expect
(
expect
(
()
async
{
await
iosDevices
.
pollingGetDevices
();
},
()
async
{
await
iosDevices
.
pollingGetDevices
();
},
throwsA
(
isA
<
UnsupportedError
>())
,
throwsUnsupportedError
,
);
);
});
});
}
}
...
...
packages/flutter_tools/test/general.shard/mdns_discovery_test.dart
View file @
7d46d436
...
@@ -214,7 +214,7 @@ void main() {
...
@@ -214,7 +214,7 @@ void main() {
);
);
expect
(
expect
(
()
async
=>
portDiscovery
.
query
(),
()
async
=>
portDiscovery
.
query
(),
throws
A
(
isA
<
Exception
>())
,
throws
Exception
,
);
);
});
});
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart
View file @
7d46d436
...
@@ -114,7 +114,7 @@ void main() {
...
@@ -114,7 +114,7 @@ void main() {
usage:
TestUsage
(),
usage:
TestUsage
(),
);
);
expect
(()
async
=>
residentWebRunner
.
run
(),
throws
A
(
isA
<
Exception
>())
);
expect
(()
async
=>
residentWebRunner
.
run
(),
throws
Exception
);
expect
(
await
residentWebRunner
.
waitForAppToFinish
(),
1
);
expect
(
await
residentWebRunner
.
waitForAppToFinish
(),
1
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
BuildSystem:
()
=>
TestBuildSystem
.
error
(
Exception
(
'foo'
)),
BuildSystem:
()
=>
TestBuildSystem
.
error
(
Exception
(
'foo'
)),
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart
View file @
7d46d436
...
@@ -212,7 +212,7 @@ void main() {
...
@@ -212,7 +212,7 @@ void main() {
);
);
await
expectLater
(
await
expectLater
(
()
=>
flutterCommand
.
run
(),
()
=>
flutterCommand
.
run
(),
throws
A
(
isA
<
ToolExit
>()
),
throws
ToolExit
(
),
);
);
expect
(
usage
.
events
,
<
TestUsageEvent
>[
expect
(
usage
.
events
,
<
TestUsageEvent
>[
const
TestUsageEvent
(
const
TestUsageEvent
(
...
@@ -436,7 +436,7 @@ void main() {
...
@@ -436,7 +436,7 @@ void main() {
await
expectLater
(
await
expectLater
(
()
=>
flutterCommand
.
run
(),
()
=>
flutterCommand
.
run
(),
throws
A
(
isA
<
ToolExit
>()
),
throws
ToolExit
(
),
);
);
expect
(
usage
.
timings
,
contains
(
expect
(
usage
.
timings
,
contains
(
const
TestTimingEvent
(
const
TestTimingEvent
(
...
...
packages/flutter_tools/test/general.shard/testbed_test.dart
View file @
7d46d436
...
@@ -96,7 +96,7 @@ void main() {
...
@@ -96,7 +96,7 @@ void main() {
ProcessUtils:
()
=>
null
,
ProcessUtils:
()
=>
null
,
});
});
expect
(()
=>
testbed
.
run
(()
{}),
throws
A
(
isA
<
StateError
>())
);
expect
(()
=>
testbed
.
run
(()
{}),
throws
StateError
);
});
});
});
});
}
}
...
...
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