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
c2ae654d
Unverified
Commit
c2ae654d
authored
Mar 05, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable avoid_single_cascade_in_expression_statements (#51944)
parent
3018d8dd
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
85 additions
and
102 deletions
+85
-102
analysis_options.yaml
analysis_options.yaml
+1
-1
ticker_test.dart
dev/automated_tests/flutter_test/ticker_test.dart
+1
-1
material_arc.dart
dev/manual_tests/lib/material_arc.dart
+2
-4
expansion_tile.dart
packages/flutter/lib/src/material/expansion_tile.dart
+2
-4
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+1
-2
ink_ripple.dart
packages/flutter/lib/src/material/ink_ripple.dart
+1
-2
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-2
binding.dart
packages/flutter/lib/src/services/binding.dart
+1
-2
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+2
-4
color_filter.dart
packages/flutter/lib/src/widgets/color_filter.dart
+1
-1
gesture_detector.dart
packages/flutter/lib/src/widgets/gesture_detector.dart
+1
-2
image_filter.dart
packages/flutter/lib/src/widgets/image_filter.dart
+2
-3
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+1
-1
nested_scroll_view.dart
packages/flutter/lib/src/widgets/nested_scroll_view.dart
+2
-4
image_cache_test.dart
packages/flutter/test/painting/image_cache_test.dart
+12
-12
gesture_detector_semantics_test.dart
...flutter/test/widgets/gesture_detector_semantics_test.dart
+2
-4
aot.dart
packages/flutter_tools/lib/src/aot.dart
+1
-1
asset.dart
packages/flutter_tools/lib/src/asset.dart
+1
-1
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+1
-1
build_web_test.dart
...er_tools/test/commands.shard/hermetic/build_web_test.dart
+3
-3
drive_test.dart
...lutter_tools/test/commands.shard/hermetic/drive_test.dart
+1
-1
generate_test.dart
...ter_tools/test/commands.shard/hermetic/generate_test.dart
+1
-1
ide_config_test.dart
...r_tools/test/commands.shard/hermetic/ide_config_test.dart
+1
-1
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+2
-2
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+3
-3
gradle_utils_test.dart
...r_tools/test/general.shard/android/gradle_utils_test.dart
+2
-2
asset_bundle_test.dart
...s/flutter_tools/test/general.shard/asset_bundle_test.dart
+1
-1
asset_bundle_variant_test.dart
...r_tools/test/general.shard/asset_bundle_variant_test.dart
+1
-1
logger_test.dart
...es/flutter_tools/test/general.shard/base/logger_test.dart
+6
-6
android_test.dart
...test/general.shard/build_system/targets/android_test.dart
+3
-3
assets_test.dart
.../test/general.shard/build_system/targets/assets_test.dart
+4
-4
ios_test.dart
...ols/test/general.shard/build_system/targets/ios_test.dart
+2
-2
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+2
-2
web_test.dart
...ols/test/general.shard/build_system/targets/web_test.dart
+3
-3
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+1
-1
pub_get_test.dart
...s/flutter_tools/test/general.shard/dart/pub_get_test.dart
+8
-8
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+1
-1
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+2
-2
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+1
-1
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+1
-2
No files found.
analysis_options.yaml
View file @
c2ae654d
...
...
@@ -79,7 +79,7 @@ linter:
# - avoid_returning_this # there are plenty of valid reasons to return this
# - avoid_setters_without_getters # not yet tested
# - avoid_shadowing_type_parameters # not yet tested
# - avoid_single_cascade_in_expression_statements # not yet tested
-
avoid_single_cascade_in_expression_statements
-
avoid_slow_async_io
-
avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
...
...
dev/automated_tests/flutter_test/ticker_test.dart
View file @
c2ae654d
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
void
main
(
)
{
testWidgets
(
'Does flutter_test catch leaking tickers?'
,
(
WidgetTester
tester
)
async
{
Ticker
((
Duration
duration
)
{
}).
.
start
();
Ticker
((
Duration
duration
)
{
}).
start
();
final
ByteData
message
=
const
StringCodec
().
encodeMessage
(
'AppLifecycleState.paused'
);
await
ServicesBinding
.
instance
.
defaultBinaryMessenger
.
handlePlatformMessage
(
'flutter/lifecycle'
,
message
,
(
_
)
{});
...
...
dev/manual_tests/lib/material_arc.dart
View file @
c2ae654d
...
...
@@ -193,8 +193,7 @@ class _PointDemoState extends State<_PointDemo> {
ImmediateMultiDragGestureRecognizer:
GestureRecognizerFactoryWithHandlers
<
ImmediateMultiDragGestureRecognizer
>(
()
=>
ImmediateMultiDragGestureRecognizer
(),
(
ImmediateMultiDragGestureRecognizer
instance
)
{
instance
..
onStart
=
_handleOnStart
;
instance
.
onStart
=
_handleOnStart
;
},
),
},
...
...
@@ -366,8 +365,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
ImmediateMultiDragGestureRecognizer:
GestureRecognizerFactoryWithHandlers
<
ImmediateMultiDragGestureRecognizer
>(
()
=>
ImmediateMultiDragGestureRecognizer
(),
(
ImmediateMultiDragGestureRecognizer
instance
)
{
instance
..
onStart
=
_handleOnStart
;
instance
.
onStart
=
_handleOnStart
;
},
),
},
...
...
packages/flutter/lib/src/material/expansion_tile.dart
View file @
c2ae654d
...
...
@@ -188,16 +188,14 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
@override
void
didChangeDependencies
()
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
_borderColorTween
..
end
=
theme
.
dividerColor
;
_borderColorTween
.
end
=
theme
.
dividerColor
;
_headerColorTween
..
begin
=
theme
.
textTheme
.
subtitle1
.
color
..
end
=
theme
.
accentColor
;
_iconColorTween
..
begin
=
theme
.
unselectedWidgetColor
..
end
=
theme
.
accentColor
;
_backgroundColorTween
..
end
=
widget
.
backgroundColor
;
_backgroundColorTween
.
end
=
widget
.
backgroundColor
;
super
.
didChangeDependencies
();
}
...
...
packages/flutter/lib/src/material/floating_action_button.dart
View file @
c2ae654d
...
...
@@ -563,8 +563,7 @@ class _ChildOverflowBox extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
_RenderChildOverflowBox
renderObject
)
{
renderObject
..
textDirection
=
Directionality
.
of
(
context
);
renderObject
.
textDirection
=
Directionality
.
of
(
context
);
}
}
...
...
packages/flutter/lib/src/material/ink_ripple.dart
View file @
c2ae654d
...
...
@@ -198,8 +198,7 @@ class InkRipple extends InteractiveInkFeature {
..
forward
();
// This confirm may have been preceded by a cancel.
_fadeInController
.
forward
();
_fadeOutController
..
animateTo
(
1.0
,
duration:
_kFadeOutDuration
);
_fadeOutController
.
animateTo
(
1.0
,
duration:
_kFadeOutDuration
);
}
@override
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
c2ae654d
...
...
@@ -581,8 +581,7 @@ class PaintingContext extends ClipContext {
..
save
()
..
transform
(
effectiveTransform
.
storage
);
painter
(
this
,
offset
);
canvas
..
restore
();
canvas
.
restore
();
return
null
;
}
}
...
...
packages/flutter/lib/src/services/binding.dart
View file @
c2ae654d
...
...
@@ -24,8 +24,7 @@ mixin ServicesBinding on BindingBase {
super
.
initInstances
();
_instance
=
this
;
_defaultBinaryMessenger
=
createBinaryMessenger
();
window
..
onPlatformMessage
=
defaultBinaryMessenger
.
handlePlatformMessage
;
window
.
onPlatformMessage
=
defaultBinaryMessenger
.
handlePlatformMessage
;
initLicenses
();
SystemChannels
.
system
.
setMessageHandler
(
handleSystemMessage
);
}
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
c2ae654d
...
...
@@ -1306,8 +1306,7 @@ class CompositedTransformTarget extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
RenderLeaderLayer
renderObject
)
{
renderObject
..
link
=
link
;
renderObject
.
link
=
link
;
}
}
...
...
@@ -4993,8 +4992,7 @@ class Flow extends MultiChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
RenderFlow
renderObject
)
{
renderObject
..
delegate
=
delegate
;
renderObject
.
delegate
=
delegate
;
}
}
...
...
packages/flutter/lib/src/widgets/color_filter.dart
View file @
c2ae654d
...
...
@@ -27,7 +27,7 @@ class ColorFiltered extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
_ColorFilterRenderObject
renderObject
)
{
renderObject
.
.
colorFilter
=
colorFilter
;
renderObject
.
colorFilter
=
colorFilter
;
}
@override
...
...
packages/flutter/lib/src/widgets/gesture_detector.dart
View file @
c2ae654d
...
...
@@ -624,8 +624,7 @@ class GestureDetector extends StatelessWidget {
gestures
[
DoubleTapGestureRecognizer
]
=
GestureRecognizerFactoryWithHandlers
<
DoubleTapGestureRecognizer
>(
()
=>
DoubleTapGestureRecognizer
(
debugOwner:
this
),
(
DoubleTapGestureRecognizer
instance
)
{
instance
..
onDoubleTap
=
onDoubleTap
;
instance
.
onDoubleTap
=
onDoubleTap
;
},
);
}
...
...
packages/flutter/lib/src/widgets/image_filter.dart
View file @
c2ae654d
...
...
@@ -30,7 +30,7 @@ class ImageFiltered extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
_ImageFilterRenderObject
renderObject
)
{
renderObject
.
.
imageFilter
=
imageFilter
;
renderObject
.
imageFilter
=
imageFilter
;
}
@override
...
...
@@ -63,8 +63,7 @@ class _ImageFilterRenderObject extends RenderProxyBox {
layer
=
ImageFilterLayer
(
imageFilter:
imageFilter
);
}
else
{
final
ImageFilterLayer
filterLayer
=
layer
as
ImageFilterLayer
;
filterLayer
..
imageFilter
=
imageFilter
;
filterLayer
.
imageFilter
=
imageFilter
;
}
context
.
pushLayer
(
layer
,
super
.
paint
,
offset
);
assert
(
layer
!=
null
);
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
c2ae654d
...
...
@@ -168,7 +168,7 @@ abstract class Route<T> {
// For example, ModalRoute create a focus scope in its overlay entries. The
// focused child can only be attached to navigator after initState which
// will be guarded by the asynchronous gap.
TickerFuture
.
complete
().
.
then
<
void
>((
void
_
)
{
TickerFuture
.
complete
().
then
<
void
>((
void
_
)
{
navigator
.
focusScopeNode
.
requestFocus
();
});
}
...
...
packages/flutter/lib/src/widgets/nested_scroll_view.dart
View file @
c2ae654d
...
...
@@ -1519,8 +1519,7 @@ class SliverOverlapAbsorber extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
RenderSliverOverlapAbsorber
renderObject
)
{
renderObject
..
handle
=
handle
;
renderObject
.
handle
=
handle
;
}
@override
...
...
@@ -1694,8 +1693,7 @@ class SliverOverlapInjector extends SingleChildRenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
RenderSliverOverlapInjector
renderObject
)
{
renderObject
..
handle
=
handle
;
renderObject
.
handle
=
handle
;
}
@override
...
...
packages/flutter/test/painting/image_cache_test.dart
View file @
c2ae654d
...
...
@@ -287,12 +287,12 @@ void main() {
test
(
'Live image cache avoids leaks of unlistened streams'
,
()
async
{
imageCache
.
maximumSize
=
3
;
const
TestImageProvider
(
1
,
1
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
2
,
2
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
3
,
3
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
4
,
4
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
5
,
5
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
6
,
6
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
1
,
1
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
2
,
2
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
3
,
3
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
4
,
4
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
5
,
5
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
6
,
6
).
resolve
(
ImageConfiguration
.
empty
);
// wait an event loop to let image resolution process.
await
null
;
...
...
@@ -304,12 +304,12 @@ void main() {
test
(
'Disabled image cache does not leak live images'
,
()
async
{
imageCache
.
maximumSize
=
0
;
const
TestImageProvider
(
1
,
1
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
2
,
2
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
3
,
3
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
4
,
4
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
5
,
5
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
6
,
6
).
.
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
1
,
1
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
2
,
2
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
3
,
3
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
4
,
4
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
5
,
5
).
resolve
(
ImageConfiguration
.
empty
);
const
TestImageProvider
(
6
,
6
).
resolve
(
ImageConfiguration
.
empty
);
// wait an event loop to let image resolution process.
await
null
;
...
...
packages/flutter/test/widgets/gesture_detector_semantics_test.dart
View file @
c2ae654d
...
...
@@ -122,8 +122,7 @@ void main() {
TapGestureRecognizer:
GestureRecognizerFactoryWithHandlers
<
TapGestureRecognizer
>(
()
=>
TapGestureRecognizer
(),
(
TapGestureRecognizer
instance
)
{
instance
..
onTap
=
()
{
logs
.
add
(
'tap'
);
};
instance
.
onTap
=
()
{
logs
.
add
(
'tap'
);
};
},
),
});
...
...
@@ -146,8 +145,7 @@ void main() {
HorizontalDragGestureRecognizer:
GestureRecognizerFactoryWithHandlers
<
HorizontalDragGestureRecognizer
>(
()
=>
HorizontalDragGestureRecognizer
(),
(
HorizontalDragGestureRecognizer
instance
)
{
instance
..
onStart
=
(
_
)
{
logs
.
add
(
'horizontal'
);
};
instance
.
onStart
=
(
_
)
{
logs
.
add
(
'horizontal'
);
};
},
),
},
...
...
packages/flutter_tools/lib/src/aot.dart
View file @
c2ae654d
...
...
@@ -103,7 +103,7 @@ class AotBuilder {
if
((
await
Future
.
wait
<
int
>(
exitCodes
.
values
)).
every
((
int
buildExitCode
)
=>
buildExitCode
==
0
))
{
final
Iterable
<
String
>
dylibs
=
iosBuilds
.
values
.
map
<
String
>(
(
String
outputDir
)
=>
globals
.
fs
.
path
.
join
(
outputDir
,
'App.framework'
,
'App'
));
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
outputPath
,
'App.framework'
)).
.
createSync
();
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
outputPath
,
'App.framework'
)).
createSync
();
await
processUtils
.
run
(
<
String
>[
'lipo'
,
...
...
packages/flutter_tools/lib/src/asset.dart
View file @
c2ae654d
...
...
@@ -418,7 +418,7 @@ class LicenseCollector {
licenseText
=
rawLicense
;
}
packageLicenses
.
putIfAbsent
(
licenseText
,
()
=>
<
String
>{})
.
.
addAll
(
packageNames
);
.
addAll
(
packageNames
);
allPackages
.
addAll
(
packageNames
);
}
}
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
c2ae654d
...
...
@@ -116,7 +116,7 @@ Future<void> main() async {
'''
;
}
environment
.
buildDir
.
childFile
(
'main.dart'
)
.
.
writeAsStringSync
(
contents
);
.
writeAsStringSync
(
contents
);
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart
View file @
c2ae654d
...
...
@@ -134,12 +134,12 @@ void main() {
// Project files.
fileSystem
.
file
(
'.packages'
)
.
.
writeAsStringSync
(
'''
.
writeAsStringSync
(
'''
foo:lib/
fizz:bar/lib/
'''
);
fileSystem
.
file
(
'pubspec.yaml'
)
.
.
writeAsStringSync
(
'''
.
writeAsStringSync
(
'''
name: foo
dependencies:
...
...
@@ -167,7 +167,7 @@ flutter:
class UrlLauncherPlugin {}
'''
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'lib'
,
'main.dart'
))
.
.
writeAsStringSync
(
'void main() { }'
);
.
writeAsStringSync
(
'void main() { }'
);
// Process calls. We're not testing that these invocations are correct because
// that is covered in targets/web_test.dart.
...
...
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
c2ae654d
...
...
@@ -42,7 +42,7 @@ void main() {
fs
.
currentDirectory
=
tempDir
;
fs
.
directory
(
'test'
).
createSync
();
fs
.
directory
(
'test_driver'
).
createSync
();
fs
.
file
(
'pubspec.yaml'
).
.
createSync
();
fs
.
file
(
'pubspec.yaml'
).
createSync
();
fs
.
file
(
'.packages'
).
createSync
();
setExitFunctionForTests
();
appStarter
=
(
DriveCommand
command
,
Uri
webUri
)
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/generate_test.dart
View file @
c2ae654d
...
...
@@ -48,7 +48,7 @@ void main() {
final
GenerateCommand
command
=
GenerateCommand
();
applyMocksToCommand
(
command
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
globals
.
fs
.
currentDirectory
.
childDirectory
(
'.dart_tool'
)
...
...
packages/flutter_tools/test/commands.shard/hermetic/ide_config_test.dart
View file @
c2ae654d
...
...
@@ -58,7 +58,7 @@ void main() {
void
_populateDir
(
Map
<
String
,
String
>
manifest
)
{
for
(
final
String
key
in
manifest
.
keys
)
{
if
(
manifest
[
key
]
==
'dir'
)
{
tempDir
.
childDirectory
(
key
).
.
createSync
(
recursive:
true
);
tempDir
.
childDirectory
(
key
).
createSync
(
recursive:
true
);
}
}
for
(
final
String
key
in
manifest
.
keys
)
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
c2ae654d
...
...
@@ -156,9 +156,9 @@ void main() {
fs
.
currentDirectory
=
tempDir
;
tempDir
.
childFile
(
'pubspec.yaml'
)
.
.
writeAsStringSync
(
'name: flutter_app'
);
.
writeAsStringSync
(
'name: flutter_app'
);
tempDir
.
childFile
(
'.packages'
)
.
.
writeAsStringSync
(
'# Generated by pub on 2019-11-25 12:38:01.801784.'
);
.
writeAsStringSync
(
'# Generated by pub on 2019-11-25 12:38:01.801784.'
);
final
Directory
libDir
=
tempDir
.
childDirectory
(
'lib'
);
libDir
.
createSync
();
final
File
mainFile
=
libDir
.
childFile
(
'main.dart'
);
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
c2ae654d
...
...
@@ -1414,7 +1414,7 @@ plugin1=${plugin1.path}
.
childDirectory
(
'apk'
)
.
childDirectory
(
'release'
)
.
childFile
(
'app-release.apk'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
await
buildGradleApp
(
project:
FlutterProject
.
current
(),
...
...
@@ -1580,7 +1580,7 @@ plugin1=${plugin1.path}
.
childDirectory
(
'apk'
)
.
childDirectory
(
'release'
)
.
childFile
(
'app-release.apk'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
await
buildGradleApp
(
project:
FlutterProject
.
current
(),
...
...
@@ -2621,7 +2621,7 @@ FlutterProject generateFakeAppBundle(String directoryName, String fileName) {
final
Directory
bundleDirectory
=
getBundleDirectory
(
project
);
bundleDirectory
.
childDirectory
(
directoryName
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
bundleDirectory
.
childDirectory
(
directoryName
)
...
...
packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart
View file @
c2ae654d
...
...
@@ -236,8 +236,8 @@ void main() {
testUsingContext
(
'returns the gradlew path'
,
()
{
final
Directory
androidDirectory
=
globals
.
fs
.
directory
(
'/android'
)..
createSync
();
androidDirectory
.
childFile
(
'gradlew'
).
.
createSync
();
androidDirectory
.
childFile
(
'gradlew.bat'
).
.
createSync
();
androidDirectory
.
childFile
(
'gradlew'
).
createSync
();
androidDirectory
.
childFile
(
'gradlew.bat'
).
createSync
();
androidDirectory
.
childFile
(
'gradle.properties'
).
createSync
();
when
(
gradleUtils
.
injectGradleWrapperIfNeeded
(
any
)).
thenReturn
(
null
);
...
...
packages/flutter_tools/test/general.shard/asset_bundle_test.dart
View file @
c2ae654d
...
...
@@ -134,7 +134,7 @@ name: example''')
// touch .packages to make sure its change time is after pubspec.yaml's
globals
.
fs
.
file
(
'.packages'
)
.
.
setLastModifiedSync
(
modifiedTime
);
.
setLastModifiedSync
(
modifiedTime
);
// Even though the previous file was removed, it is left in the
// asset manifest and not updated. This is due to the devfs not
...
...
packages/flutter_tools/test/general.shard/asset_bundle_variant_test.dart
View file @
c2ae654d
...
...
@@ -57,7 +57,7 @@ flutter:
- a/b/c/foo
'''
);
globals
.
fs
.
file
(
'.packages'
).
.
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
final
List
<
String
>
assets
=
<
String
>[
'a/b/c/foo'
,
...
...
packages/flutter_tools/test/general.shard/base/logger_test.dart
View file @
c2ae654d
...
...
@@ -921,8 +921,8 @@ void main() {
outputPreferences:
OutputPreferences
.
test
(
showColor:
false
),
timeoutConfiguration:
const
TimeoutConfiguration
(),
);
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
final
List
<
String
>
output
=
outputStdout
();
expect
(
output
.
length
,
equals
(
3
));
...
...
@@ -947,8 +947,8 @@ void main() {
),
stopwatchFactory:
FakeStopwatchFactory
(),
);
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
expect
(
outputStdout
(),
<
Matcher
>[
matches
(
r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] AAA$'
),
...
...
@@ -967,8 +967,8 @@ void main() {
),
outputPreferences:
OutputPreferences
.
test
(),
);
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
.
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
const
TimeoutConfiguration
().
fastOperation
).
stop
();
expect
(
logger
.
statusText
,
'AAA
\n
BBB
\n
'
);
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/android_test.dart
View file @
c2ae654d
...
...
@@ -34,7 +34,7 @@ void main() {
// create pre-requisites.
environment
.
buildDir
.
childFile
(
'app.dill'
)
.
.
writeAsStringSync
(
'abcd'
);
.
writeAsStringSync
(
'abcd'
);
final
Directory
hostDirectory
=
globals
.
fs
.
currentDirectory
.
childDirectory
(
getNameForHostPlatform
(
getCurrentHostPlatform
()))
..
createSync
(
recursive:
true
);
...
...
@@ -61,7 +61,7 @@ void main() {
// create pre-requisites.
environment
.
buildDir
.
childFile
(
'app.so'
)
.
.
writeAsStringSync
(
'abcd'
);
.
writeAsStringSync
(
'abcd'
);
await
const
ProfileAndroidApplication
().
build
(
environment
);
...
...
@@ -80,7 +80,7 @@ void main() {
// create pre-requisites.
environment
.
buildDir
.
childFile
(
'app.so'
)
.
.
writeAsStringSync
(
'abcd'
);
.
writeAsStringSync
(
'abcd'
);
await
const
ReleaseAndroidApplication
().
build
(
environment
);
...
...
packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart
View file @
c2ae654d
...
...
@@ -26,13 +26,13 @@ void main() {
);
fileSystem
.
file
(
environment
.
buildDir
.
childFile
(
'app.dill'
)).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'packages/flutter_tools/lib/src/build_system/targets/assets.dart'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
fileSystem
.
file
(
'assets/foo/bar.png'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
fileSystem
.
file
(
'assets/wildcard/#bar.png'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
fileSystem
.
file
(
'.packages'
)
.
.
createSync
();
.
createSync
();
fileSystem
.
file
(
'pubspec.yaml'
)
..
createSync
()
..
writeAsStringSync
(
'''
...
...
packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart
View file @
c2ae654d
...
...
@@ -111,7 +111,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
// Plist file
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'ios'
,
'Flutter'
,
'AppFrameworkInfo.plist'
))
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
// App kernel
environment
.
buildDir
.
childFile
(
'app.dill'
).
createSync
(
recursive:
true
);
// Stub framework
...
...
@@ -140,7 +140,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
// Plist file
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'ios'
,
'Flutter'
,
'AppFrameworkInfo.plist'
))
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
// Real framework
environment
.
buildDir
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
c2ae654d
...
...
@@ -137,7 +137,7 @@ void main() {
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
'darwin-x64'
,
'isolate_snapshot.bin'
)).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
environment
.
buildDir
.
path
,
'App.framework'
,
'App'
))
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
final
String
inputKernel
=
globals
.
fs
.
path
.
join
(
environment
.
buildDir
.
path
,
'app.dill'
);
final
String
outputKernel
=
globals
.
fs
.
path
.
join
(
'App.framework'
,
'Versions'
,
'A'
,
'Resources'
,
...
...
@@ -160,7 +160,7 @@ void main() {
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
'darwin-x64'
,
'isolate_snapshot.bin'
)).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
environment
.
buildDir
.
path
,
'App.framework'
,
'App'
))
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
final
String
outputKernel
=
globals
.
fs
.
path
.
join
(
'App.framework'
,
'Resources'
,
'flutter_assets'
,
'kernel_blob.bin'
);
final
String
precompiledVm
=
globals
.
fs
.
path
.
join
(
'App.framework'
,
'Resources'
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart
View file @
c2ae654d
...
...
@@ -90,9 +90,9 @@ void main() {
environment
.
defines
[
kBuildMode
]
=
'release'
;
final
Directory
webResources
=
environment
.
projectDir
.
childDirectory
(
'web'
);
webResources
.
childFile
(
'index.html'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
webResources
.
childFile
(
'foo.txt'
)
.
.
writeAsStringSync
(
'A'
);
.
writeAsStringSync
(
'A'
);
environment
.
buildDir
.
childFile
(
'main.dart.js'
).
createSync
();
await
const
WebReleaseBundle
().
build
(
environment
);
...
...
@@ -315,7 +315,7 @@ void main() {
environment
.
defines
[
kBuildMode
]
=
'release'
;
when
(
globals
.
processManager
.
run
(
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
environment
.
buildDir
.
childFile
(
'main.dart.js.deps'
)
.
.
writeAsStringSync
(
'file:///a.dart'
);
.
writeAsStringSync
(
'file:///a.dart'
);
return
FakeProcessResult
(
exitCode:
0
);
});
await
const
Dart2JSTarget
().
build
(
environment
);
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
c2ae654d
...
...
@@ -423,7 +423,7 @@ void main() {
final
File
ideviceScreenshotFile
=
iosUsbArtifacts
.
location
.
childFile
(
'idevicescreenshot'
)
..
createSync
();
iosUsbArtifacts
.
location
.
childFile
(
'idevicesyslog'
)
.
.
createSync
();
.
createSync
();
expect
(
iosUsbArtifacts
.
isUpToDateInner
(),
true
);
...
...
packages/flutter_tools/test/general.shard/dart/pub_get_test.dart
View file @
c2ae654d
...
...
@@ -260,7 +260,7 @@ void main() {
],
onRun:
()
{
globals
.
fs
.
file
(
'.packages'
)
.
.
setLastModifiedSync
(
DateTime
(
2002
));
.
setLastModifiedSync
(
DateTime
(
2002
));
}
),
const
FakeCommand
(
...
...
@@ -280,7 +280,7 @@ void main() {
],
onRun:
()
{
globals
.
fs
.
file
(
'pubspec.yaml'
)
.
.
setLastModifiedSync
(
DateTime
(
2002
));
.
setLastModifiedSync
(
DateTime
(
2002
));
}
),
const
FakeCommand
(
...
...
@@ -309,9 +309,9 @@ void main() {
testLogger
.
clear
();
// bad scenario 1: pub doesn't update file; doesn't matter, because we do instead
globals
.
fs
.
file
(
'.packages'
)
.
.
setLastModifiedSync
(
DateTime
(
2000
));
.
setLastModifiedSync
(
DateTime
(
2000
));
globals
.
fs
.
file
(
'pubspec.yaml'
)
.
.
setLastModifiedSync
(
DateTime
(
2001
));
.
setLastModifiedSync
(
DateTime
(
2001
));
await
pub
.
get
(
context:
PubContext
.
flutterTests
,
checkLastModified:
true
);
// pub does nothing
expect
(
testLogger
.
statusText
,
'Running "flutter pub get" in /...
\n
'
);
expect
(
testLogger
.
errorText
,
isEmpty
);
...
...
@@ -321,9 +321,9 @@ void main() {
testLogger
.
clear
();
// bad scenario 2: pub changes pubspec.yaml instead
globals
.
fs
.
file
(
'.packages'
)
.
.
setLastModifiedSync
(
DateTime
(
2000
));
.
setLastModifiedSync
(
DateTime
(
2000
));
globals
.
fs
.
file
(
'pubspec.yaml'
)
.
.
setLastModifiedSync
(
DateTime
(
2001
));
.
setLastModifiedSync
(
DateTime
(
2001
));
try
{
await
pub
.
get
(
context:
PubContext
.
flutterTests
,
checkLastModified:
true
);
expect
(
true
,
isFalse
,
reason:
'pub.get did not throw'
);
...
...
@@ -337,9 +337,9 @@ void main() {
expect
(
globals
.
fs
.
file
(
'.packages'
).
lastModifiedSync
(),
DateTime
(
2000
));
// because nothing touched it
// bad scenario 3: pubspec.yaml was created in the future
globals
.
fs
.
file
(
'.packages'
)
.
.
setLastModifiedSync
(
DateTime
(
2000
));
.
setLastModifiedSync
(
DateTime
(
2000
));
globals
.
fs
.
file
(
'pubspec.yaml'
)
.
.
setLastModifiedSync
(
DateTime
(
9999
));
.
setLastModifiedSync
(
DateTime
(
9999
));
assert
(
DateTime
(
9999
).
isAfter
(
DateTime
.
now
()));
await
pub
.
get
(
context:
PubContext
.
flutterTests
,
checkLastModified:
true
);
// pub does nothing
expect
(
testLogger
.
statusText
,
contains
(
'Running "flutter pub get" in /...
\n
'
));
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
c2ae654d
...
...
@@ -575,7 +575,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
..
writeAsStringSync
(
'Existing lock file.'
);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
10
));
projectUnderTest
.
ios
.
podfile
.
.
writeAsStringSync
(
'Updated Podfile'
);
.
writeAsStringSync
(
'Updated Podfile'
);
await
cocoaPodsUnderTest
.
processPods
(
xcodeProject:
projectUnderTest
.
ios
,
engineDir:
'engine/path'
,
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
c2ae654d
...
...
@@ -236,7 +236,7 @@ flutter:
.
childDirectory
(
'java'
)
.
childDirectory
(
pluginName
)
.
childFile
(
'UseOldEmbedding.java'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
flutterProject
.
directory
.
childFile
(
'.packages'
)
...
...
@@ -855,7 +855,7 @@ EndGlobal''');
.
childDirectory
(
'lib'
)
.
childDirectory
(
'src'
)
.
childFile
(
'web_plugin.dart'
)
.
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
flutterProject
.
directory
.
childFile
(
'.packages'
)
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
c2ae654d
...
...
@@ -81,7 +81,7 @@ void main() {
urlTunneller:
null
,
)
as
ResidentWebRunner
;
globals
.
fs
.
currentDirectory
.
childFile
(
'.packages'
)
.
.
writeAsStringSync
(
'
\n
'
);
.
writeAsStringSync
(
'
\n
'
);
},
);
});
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
c2ae654d
...
...
@@ -632,8 +632,7 @@ class MockDeviceLogReader extends DeviceLogReader {
}
void
applyMocksToCommand
(
FlutterCommand
command
)
{
command
..
applicationPackages
=
MockApplicationPackageStore
();
command
.
applicationPackages
=
MockApplicationPackageStore
();
}
/// Common functionality for tracking mock interaction
...
...
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