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
d340e2f2
Unverified
Commit
d340e2f2
authored
Oct 04, 2018
by
Alexandre Ardhuin
Committed by
GitHub
Oct 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply lint prefer_void_to_null in dev/ (#22661)
parent
89c5ace1
Changes
107
Show whitespace changes
Inline
Side-by-side
Showing
107 changed files
with
210 additions
and
212 deletions
+210
-212
exception_handling_test.dart
...automated_tests/flutter_test/exception_handling_test.dart
+1
-1
test_async_utils_guarded_test.dart
...ted_tests/flutter_test/test_async_utils_guarded_test.dart
+1
-1
test_async_utils_unguarded_test.dart
...d_tests/flutter_test/test_async_utils_unguarded_test.dart
+1
-1
scroll_perf_test.dart
...nchmarks/complex_layout/test_driver/scroll_perf_test.dart
+4
-4
semantics_perf_test.dart
...marks/complex_layout/test_driver/semantics_perf_test.dart
+1
-1
scroll_perf.dart
dev/benchmarks/complex_layout/test_memory/scroll_perf.dart
+3
-3
animation_bench.dart
...enchmarks/microbenchmarks/lib/stocks/animation_bench.dart
+1
-1
build_bench.dart
dev/benchmarks/microbenchmarks/lib/stocks/build_bench.dart
+1
-1
layout_bench.dart
dev/benchmarks/microbenchmarks/lib/stocks/layout_bench.dart
+1
-1
analyze-sample-code.dart
dev/bots/analyze-sample-code.dart
+1
-1
analyze.dart
dev/bots/analyze.dart
+8
-10
prepare_package.dart
dev/bots/prepare_package.dart
+9
-9
run_command.dart
dev/bots/run_command.dart
+1
-1
test.dart
dev/bots/test.dart
+9
-9
README.md
dev/devicelab/README.md
+1
-1
run.dart
dev/devicelab/bin/run.dart
+1
-1
analyzer_benchmark.dart
dev/devicelab/bin/tasks/analyzer_benchmark.dart
+1
-1
android_sample_catalog_generator.dart
...devicelab/bin/tasks/android_sample_catalog_generator.dart
+1
-1
basic_material_app_android__compile.dart
...icelab/bin/tasks/basic_material_app_android__compile.dart
+1
-1
basic_material_app_ios__compile.dart
dev/devicelab/bin/tasks/basic_material_app_ios__compile.dart
+1
-1
basic_material_app_win__compile.dart
dev/devicelab/bin/tasks/basic_material_app_win__compile.dart
+1
-1
channels_integration_test.dart
dev/devicelab/bin/tasks/channels_integration_test.dart
+1
-1
channels_integration_test_ios.dart
dev/devicelab/bin/tasks/channels_integration_test_ios.dart
+1
-1
channels_integration_test_win.dart
dev/devicelab/bin/tasks/channels_integration_test_win.dart
+1
-1
commands_test.dart
dev/devicelab/bin/tasks/commands_test.dart
+2
-2
complex_layout__start_up.dart
dev/devicelab/bin/tasks/complex_layout__start_up.dart
+1
-1
complex_layout_android__compile.dart
dev/devicelab/bin/tasks/complex_layout_android__compile.dart
+1
-1
complex_layout_ios__compile.dart
dev/devicelab/bin/tasks/complex_layout_ios__compile.dart
+1
-1
complex_layout_ios__start_up.dart
dev/devicelab/bin/tasks/complex_layout_ios__start_up.dart
+1
-1
complex_layout_scroll_perf__memory.dart
...vicelab/bin/tasks/complex_layout_scroll_perf__memory.dart
+1
-1
complex_layout_scroll_perf__timeline_summary.dart
...n/tasks/complex_layout_scroll_perf__timeline_summary.dart
+1
-1
complex_layout_scroll_perf_ios__timeline_summary.dart
...sks/complex_layout_scroll_perf_ios__timeline_summary.dart
+1
-1
complex_layout_win__compile.dart
dev/devicelab/bin/tasks/complex_layout_win__compile.dart
+1
-1
dartdocs.dart
dev/devicelab/bin/tasks/dartdocs.dart
+1
-1
embedded_android_views_integration_test.dart
...ab/bin/tasks/embedded_android_views_integration_test.dart
+1
-1
external_ui_integration_test.dart
dev/devicelab/bin/tasks/external_ui_integration_test.dart
+1
-1
external_ui_integration_test_ios.dart
...devicelab/bin/tasks/external_ui_integration_test_ios.dart
+1
-1
flavors_test.dart
dev/devicelab/bin/tasks/flavors_test.dart
+1
-1
flavors_test_ios.dart
dev/devicelab/bin/tasks/flavors_test_ios.dart
+1
-1
flavors_test_win.dart
dev/devicelab/bin/tasks/flavors_test_win.dart
+1
-1
flutter_attach_test.dart
dev/devicelab/bin/tasks/flutter_attach_test.dart
+7
-7
flutter_gallery__back_button_memory.dart
...icelab/bin/tasks/flutter_gallery__back_button_memory.dart
+3
-3
flutter_gallery__memory_nav.dart
dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
+1
-1
flutter_gallery__start_up.dart
dev/devicelab/bin/tasks/flutter_gallery__start_up.dart
+1
-1
flutter_gallery__transition_perf.dart
...devicelab/bin/tasks/flutter_gallery__transition_perf.dart
+1
-1
flutter_gallery__transition_perf_with_semantics.dart
...asks/flutter_gallery__transition_perf_with_semantics.dart
+1
-1
flutter_gallery_android__compile.dart
...devicelab/bin/tasks/flutter_gallery_android__compile.dart
+1
-1
flutter_gallery_instrumentation_test.dart
...celab/bin/tasks/flutter_gallery_instrumentation_test.dart
+1
-1
flutter_gallery_ios32__start_up.dart
dev/devicelab/bin/tasks/flutter_gallery_ios32__start_up.dart
+1
-1
flutter_gallery_ios32__transition_perf.dart
...lab/bin/tasks/flutter_gallery_ios32__transition_perf.dart
+1
-1
flutter_gallery_ios__compile.dart
dev/devicelab/bin/tasks/flutter_gallery_ios__compile.dart
+1
-1
flutter_gallery_ios__start_up.dart
dev/devicelab/bin/tasks/flutter_gallery_ios__start_up.dart
+1
-1
flutter_gallery_ios__transition_perf.dart
...celab/bin/tasks/flutter_gallery_ios__transition_perf.dart
+1
-1
flutter_gallery_win__compile.dart
dev/devicelab/bin/tasks/flutter_gallery_win__compile.dart
+1
-1
flutter_view__start_up.dart
dev/devicelab/bin/tasks/flutter_view__start_up.dart
+1
-1
flutter_view_ios__start_up.dart
dev/devicelab/bin/tasks/flutter_view_ios__start_up.dart
+1
-1
gradle_plugin_test.dart
dev/devicelab/bin/tasks/gradle_plugin_test.dart
+6
-6
hello_world__memory.dart
dev/devicelab/bin/tasks/hello_world__memory.dart
+3
-3
hello_world_android__compile.dart
dev/devicelab/bin/tasks/hello_world_android__compile.dart
+1
-1
hello_world_ios__compile.dart
dev/devicelab/bin/tasks/hello_world_ios__compile.dart
+1
-1
hot_mode_dev_cycle__benchmark.dart
dev/devicelab/bin/tasks/hot_mode_dev_cycle__benchmark.dart
+1
-1
hot_mode_dev_cycle_linux__benchmark.dart
...icelab/bin/tasks/hot_mode_dev_cycle_linux__benchmark.dart
+1
-1
hot_mode_dev_cycle_win__benchmark.dart
...evicelab/bin/tasks/hot_mode_dev_cycle_win__benchmark.dart
+1
-1
integration_ui.dart
dev/devicelab/bin/tasks/integration_ui.dart
+1
-1
integration_ui_ios.dart
dev/devicelab/bin/tasks/integration_ui_ios.dart
+1
-1
ios_sample_catalog_generator.dart
dev/devicelab/bin/tasks/ios_sample_catalog_generator.dart
+1
-1
microbenchmarks.dart
dev/devicelab/bin/tasks/microbenchmarks.dart
+1
-1
microbenchmarks_ios.dart
dev/devicelab/bin/tasks/microbenchmarks_ios.dart
+1
-1
module_test.dart
dev/devicelab/bin/tasks/module_test.dart
+1
-1
module_test_ios.dart
dev/devicelab/bin/tasks/module_test_ios.dart
+1
-1
platform_channel_sample_test.dart
dev/devicelab/bin/tasks/platform_channel_sample_test.dart
+1
-1
platform_channel_sample_test_ios.dart
...devicelab/bin/tasks/platform_channel_sample_test_ios.dart
+1
-1
platform_interaction_test.dart
dev/devicelab/bin/tasks/platform_interaction_test.dart
+1
-1
platform_interaction_test_ios.dart
dev/devicelab/bin/tasks/platform_interaction_test_ios.dart
+1
-1
platform_view__start_up.dart
dev/devicelab/bin/tasks/platform_view__start_up.dart
+1
-1
platform_view_ios__start_up.dart
dev/devicelab/bin/tasks/platform_view_ios__start_up.dart
+1
-1
plugin_test.dart
dev/devicelab/bin/tasks/plugin_test.dart
+1
-1
plugin_test_ios.dart
dev/devicelab/bin/tasks/plugin_test_ios.dart
+1
-1
plugin_test_win.dart
dev/devicelab/bin/tasks/plugin_test_win.dart
+1
-1
routing_test.dart
dev/devicelab/bin/tasks/routing_test.dart
+1
-1
run_machine_concurrent_hot_reload.dart
...evicelab/bin/tasks/run_machine_concurrent_hot_reload.dart
+1
-1
run_release_test.dart
dev/devicelab/bin/tasks/run_release_test.dart
+1
-1
service_extensions_test.dart
dev/devicelab/bin/tasks/service_extensions_test.dart
+1
-1
smoke_test_failure.dart
dev/devicelab/bin/tasks/smoke_test_failure.dart
+1
-1
smoke_test_setup_failure.dart
dev/devicelab/bin/tasks/smoke_test_setup_failure.dart
+1
-1
smoke_test_success.dart
dev/devicelab/bin/tasks/smoke_test_success.dart
+1
-1
smoke_test_throws.dart
dev/devicelab/bin/tasks/smoke_test_throws.dart
+1
-1
technical_debt__cost.dart
dev/devicelab/bin/tasks/technical_debt__cost.dart
+1
-1
tiles_scroll_perf__timeline_summary.dart
...icelab/bin/tasks/tiles_scroll_perf__timeline_summary.dart
+1
-1
adb.dart
dev/devicelab/lib/framework/adb.dart
+25
-25
ios.dart
dev/devicelab/lib/framework/ios.dart
+3
-3
runner.dart
dev/devicelab/lib/framework/runner.dart
+2
-2
utils.dart
dev/devicelab/lib/framework/utils.dart
+11
-11
hot_mode_tests.dart
dev/devicelab/lib/tasks/hot_mode_tests.dart
+8
-8
plugin_tests.dart
dev/devicelab/lib/tasks/plugin_tests.dart
+4
-4
save_catalog_screenshots.dart
dev/devicelab/lib/tasks/save_catalog_screenshots.dart
+3
-3
adb_test.dart
dev/devicelab/test/adb_test.dart
+1
-1
main.dart
dev/integration_tests/external_ui/lib/main.dart
+4
-4
main_test.dart
dev/integration_tests/external_ui/test_driver/main_test.dart
+3
-3
driver_test.dart
dev/integration_tests/ui/test_driver/driver_test.dart
+4
-4
keyboard_resize_test.dart
...ntegration_tests/ui/test_driver/keyboard_resize_test.dart
+2
-2
keyboard_textfield_test.dart
...gration_tests/ui/test_driver/keyboard_textfield_test.dart
+1
-1
material_arc.dart
dev/manual_tests/lib/material_arc.dart
+1
-1
dartdoc.dart
dev/tools/dartdoc.dart
+1
-1
gen_date_localizations.dart
dev/tools/gen_date_localizations.dart
+1
-1
java_and_objc_doc.dart
dev/tools/java_and_objc_doc.dart
+2
-2
vitool.dart
dev/tools/vitool/lib/vitool.dart
+1
-1
No files found.
dev/automated_tests/flutter_test/exception_handling_test.dart
View file @
d340e2f2
...
...
@@ -13,6 +13,6 @@ void main() {
throw
FlutterError
(
'Who lives, who dies, who tells your story?'
);
});
testWidgets
(
'Exception handling in test harness - uncaught Future error'
,
(
WidgetTester
tester
)
async
{
Future
<
Null
>.
error
(
'Who lives, who dies, who tells your story?'
);
Future
<
void
>.
error
(
'Who lives, who dies, who tells your story?'
);
});
}
dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart
View file @
d340e2f2
...
...
@@ -12,7 +12,7 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
static
void
testPrint
(
String
message
,
{
int
wrapWidth
})
{
print
(
message
);
}
}
Future
<
Null
>
guardedHelper
(
WidgetTester
tester
)
{
Future
<
void
>
guardedHelper
(
WidgetTester
tester
)
{
return
TestAsyncUtils
.
guard
(()
async
{
await
tester
.
pumpWidget
(
const
Text
(
'Hello'
,
textDirection:
TextDirection
.
ltr
));
});
...
...
dev/automated_tests/flutter_test/test_async_utils_unguarded_test.dart
View file @
d340e2f2
...
...
@@ -11,7 +11,7 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
static
void
testPrint
(
String
message
,
{
int
wrapWidth
})
{
print
(
message
);
}
}
Future
<
Null
>
helperFunction
(
WidgetTester
tester
)
async
{
Future
<
void
>
helperFunction
(
WidgetTester
tester
)
async
{
await
tester
.
pump
();
}
...
...
dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart
View file @
d340e2f2
...
...
@@ -20,12 +20,12 @@ void main() {
driver
.
close
();
});
Future
<
Null
>
testScrollPerf
(
String
listKey
,
String
summaryName
)
async
{
Future
<
void
>
testScrollPerf
(
String
listKey
,
String
summaryName
)
async
{
// The slight initial delay avoids starting the timing during a
// period of increased load on the device. Without this delay, the
// benchmark has greater noise.
// See: https://github.com/flutter/flutter/issues/19434
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
250
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
250
));
final
Timeline
timeline
=
await
driver
.
traceAction
(()
async
{
// Find the scrollable stock list
final
SerializableFinder
list
=
find
.
byValueKey
(
listKey
);
...
...
@@ -34,13 +34,13 @@ void main() {
// Scroll down
for
(
int
i
=
0
;
i
<
5
;
i
+=
1
)
{
await
driver
.
scroll
(
list
,
0.0
,
-
300.0
,
const
Duration
(
milliseconds:
300
));
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
500
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
// Scroll up
for
(
int
i
=
0
;
i
<
5
;
i
+=
1
)
{
await
driver
.
scroll
(
list
,
0.0
,
300.0
,
const
Duration
(
milliseconds:
300
));
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
500
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
});
...
...
dev/benchmarks/complex_layout/test_driver/semantics_perf_test.dart
View file @
d340e2f2
...
...
@@ -25,7 +25,7 @@ void main() {
test
(
'inital tree creation'
,
()
async
{
// Let app become fully idle.
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
2
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
2
));
final
Timeline
timeline
=
await
driver
.
traceAction
(()
async
{
expect
(
await
driver
.
setSemantics
(
true
),
isTrue
);
...
...
dev/benchmarks/complex_layout/test_memory/scroll_perf.dart
View file @
d340e2f2
...
...
@@ -37,7 +37,7 @@ Future<void> main() async {
/// Wait 50ms to allow the GPU thread to actually put up the frame. (The
/// endOfFrame future ends when we send the data to the engine, before the GPU
/// thread has had a chance to rasterize, etc.)
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
50
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
50
));
debugPrint
(
'==== MEMORY BENCHMARK ==== READY ===='
);
await
ready
.
future
;
// waits for tap sent by devicelab task
...
...
@@ -58,14 +58,14 @@ Future<void> main() async {
for
(
int
iteration
=
0
;
iteration
<
maxIterations
;
iteration
+=
1
)
{
debugPrint
(
'Scroll down...
$iteration
/
$maxIterations
'
);
await
controller
.
fling
(
find
.
byType
(
ListView
),
const
Offset
(
0.0
,
-
700.0
),
speed
);
await
Future
<
Null
>.
delayed
(
pauses
);
await
Future
<
void
>.
delayed
(
pauses
);
}
// Scroll up
for
(
int
iteration
=
0
;
iteration
<
maxIterations
;
iteration
+=
1
)
{
debugPrint
(
'Scroll up...
$iteration
/
$maxIterations
'
);
await
controller
.
fling
(
find
.
byType
(
ListView
),
const
Offset
(
0.0
,
300.0
),
speed
);
await
Future
<
Null
>.
delayed
(
pauses
);
await
Future
<
void
>.
delayed
(
pauses
);
}
debugPrint
(
'==== MEMORY BENCHMARK ==== DONE ===='
);
...
...
dev/benchmarks/microbenchmarks/lib/stocks/animation_bench.dart
View file @
d340e2f2
...
...
@@ -33,7 +33,7 @@ class BenchmarkingBinding extends LiveTestWidgetsFlutterBinding {
}
}
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
assert
(
false
);
// don't run this in checked mode! Use --release.
stock_data
.
StockData
.
actuallyFetchData
=
false
;
...
...
dev/benchmarks/microbenchmarks/lib/stocks/build_bench.dart
View file @
d340e2f2
...
...
@@ -15,7 +15,7 @@ import '../common.dart';
const
Duration
kBenchmarkTime
=
Duration
(
seconds:
15
);
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
assert
(
false
);
// don't run this in checked mode! Use --release.
stock_data
.
StockData
.
actuallyFetchData
=
false
;
...
...
dev/benchmarks/microbenchmarks/lib/stocks/layout_bench.dart
View file @
d340e2f2
...
...
@@ -15,7 +15,7 @@ import '../common.dart';
const
Duration
kBenchmarkTime
=
Duration
(
seconds:
15
);
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
stock_data
.
StockData
.
actuallyFetchData
=
false
;
// We control the framePolicy below to prevent us from scheduling frames in
...
...
dev/bots/analyze-sample-code.dart
View file @
d340e2f2
...
...
@@ -99,7 +99,7 @@ class Section {
const
String
kDartDocPrefix
=
'///'
;
const
String
kDartDocPrefixWithSpace
=
'
$kDartDocPrefix
'
;
Future
<
Null
>
main
(
List
<
String
>
arguments
)
async
{
Future
<
void
>
main
(
List
<
String
>
arguments
)
async
{
final
Directory
tempDir
=
Directory
.
systemTemp
.
createTempSync
(
'flutter_analyze_sample_code.'
);
int
exitCode
=
1
;
bool
keepMain
=
false
;
...
...
dev/bots/analyze.dart
View file @
d340e2f2
...
...
@@ -11,8 +11,6 @@ import 'package:meta/meta.dart';
import
'run_command.dart'
;
typedef
ShardRunner
=
Future
<
Null
>
Function
();
final
String
flutterRoot
=
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
path
.
fromUri
(
Platform
.
script
))));
final
String
flutter
=
path
.
join
(
flutterRoot
,
'bin'
,
Platform
.
isWindows
?
'flutter.bat'
:
'flutter'
);
final
String
dart
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
Platform
.
isWindows
?
'dart.exe'
:
'dart'
);
...
...
@@ -25,7 +23,7 @@ final String pubCache = path.join(flutterRoot, '.pub-cache');
///
/// For example:
/// bin/cache/dart-sdk/bin/dart dev/bots/analyze.dart --dart-sdk=/tmp/dart-sdk
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
await
_verifyNoTestPackageImports
(
flutterRoot
);
await
_verifyGeneratedPluginRegistrants
(
flutterRoot
);
await
_verifyNoBadImportsInFlutter
(
flutterRoot
);
...
...
@@ -84,7 +82,7 @@ Future<Null> main(List<String> args) async {
print
(
'
${bold}
DONE: Analysis successful.
$reset
'
);
}
Future
<
Null
>
_verifyInternationalizations
()
async
{
Future
<
void
>
_verifyInternationalizations
()
async
{
final
EvalResult
genResult
=
await
_evalCommand
(
dart
,
<
String
>[
...
...
@@ -134,7 +132,7 @@ Future<String> _getCommitRange() async {
}
Future
<
Null
>
_checkForTrailingSpaces
()
async
{
Future
<
void
>
_checkForTrailingSpaces
()
async
{
if
(!
Platform
.
isWindows
)
{
final
String
commitRange
=
Platform
.
environment
.
containsKey
(
'TEST_COMMIT_RANGE'
)
?
Platform
.
environment
[
'TEST_COMMIT_RANGE'
]
...
...
@@ -229,7 +227,7 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
return
result
;
}
Future
<
Null
>
_runFlutterAnalyze
(
String
workingDirectory
,
{
Future
<
void
>
_runFlutterAnalyze
(
String
workingDirectory
,
{
List
<
String
>
options
=
const
<
String
>[]
})
{
return
runCommand
(
flutter
,
<
String
>[
'analyze'
]..
addAll
(
options
),
...
...
@@ -237,7 +235,7 @@ Future<Null> _runFlutterAnalyze(String workingDirectory, {
);
}
Future
<
Null
>
_verifyNoTestPackageImports
(
String
workingDirectory
)
async
{
Future
<
void
>
_verifyNoTestPackageImports
(
String
workingDirectory
)
async
{
// TODO(ianh): Remove this whole test once https://github.com/dart-lang/matcher/issues/98 is fixed.
final
List
<
String
>
shims
=
<
String
>[];
final
List
<
String
>
errors
=
Directory
(
workingDirectory
)
...
...
@@ -315,7 +313,7 @@ Future<Null> _verifyNoTestPackageImports(String workingDirectory) async {
}
}
Future
<
Null
>
_verifyNoBadImportsInFlutter
(
String
workingDirectory
)
async
{
Future
<
void
>
_verifyNoBadImportsInFlutter
(
String
workingDirectory
)
async
{
final
List
<
String
>
errors
=
<
String
>[];
final
String
libPath
=
path
.
join
(
workingDirectory
,
'packages'
,
'flutter'
,
'lib'
);
final
String
srcPath
=
path
.
join
(
workingDirectory
,
'packages'
,
'flutter'
,
'lib'
,
'src'
);
...
...
@@ -439,7 +437,7 @@ List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) {
return
null
;
}
Future
<
Null
>
_verifyNoBadImportsInFlutterTools
(
String
workingDirectory
)
async
{
Future
<
void
>
_verifyNoBadImportsInFlutterTools
(
String
workingDirectory
)
async
{
final
List
<
String
>
errors
=
<
String
>[];
for
(
FileSystemEntity
entity
in
Directory
(
path
.
join
(
workingDirectory
,
'packages'
,
'flutter_tools'
,
'lib'
))
.
listSync
(
recursive:
true
)
...
...
@@ -463,7 +461,7 @@ Future<Null> _verifyNoBadImportsInFlutterTools(String workingDirectory) async {
}
}
Future
<
Null
>
_verifyGeneratedPluginRegistrants
(
String
flutterRoot
)
async
{
Future
<
void
>
_verifyGeneratedPluginRegistrants
(
String
flutterRoot
)
async
{
final
Directory
flutterRootDir
=
Directory
(
flutterRoot
);
final
Map
<
String
,
List
<
File
>>
packageToRegistrants
=
<
String
,
List
<
File
>>{};
...
...
dev/bots/prepare_package.dart
View file @
d340e2f2
...
...
@@ -119,8 +119,8 @@ class ProcessRunner {
stderr
.
write
(
'Running "
${commandLine.join(' ')}
" in
${workingDirectory.path}
.
\n
'
);
}
final
List
<
int
>
output
=
<
int
>[];
final
Completer
<
Null
>
stdoutComplete
=
Completer
<
Null
>();
final
Completer
<
Null
>
stderrComplete
=
Completer
<
Null
>();
final
Completer
<
void
>
stdoutComplete
=
Completer
<
void
>();
final
Completer
<
void
>
stderrComplete
=
Completer
<
void
>();
Process
process
;
Future
<
int
>
allComplete
()
async
{
await
stderrComplete
.
future
;
...
...
@@ -291,7 +291,7 @@ class ArchiveCreator {
/// Clone the Flutter repo and make sure that the git environment is sane
/// for when the user will unpack it.
Future
<
Null
>
_checkoutFlutter
()
async
{
Future
<
void
>
_checkoutFlutter
()
async
{
// We want the user to start out the in the specified branch instead of a
// detached head. To do that, we need to make sure the branch points at the
// desired revision.
...
...
@@ -303,7 +303,7 @@ class ArchiveCreator {
}
/// Retrieve the MinGit executable from storage and unpack it.
Future
<
Null
>
_installMinGitIfNeeded
()
async
{
Future
<
void
>
_installMinGitIfNeeded
()
async
{
if
(!
platform
.
isWindows
)
{
return
;
}
...
...
@@ -319,7 +319,7 @@ class ArchiveCreator {
/// Prepare the archive repo so that it has all of the caches warmed up and
/// is configured for the user to begin working.
Future
<
Null
>
_populateCaches
()
async
{
Future
<
void
>
_populateCaches
()
async
{
await
_runFlutter
(<
String
>[
'doctor'
]);
await
_runFlutter
(<
String
>[
'update-packages'
]);
await
_runFlutter
(<
String
>[
'precache'
]);
...
...
@@ -342,7 +342,7 @@ class ArchiveCreator {
}
/// Write the archive to the given output file.
Future
<
Null
>
_archiveFiles
(
File
outputFile
)
async
{
Future
<
void
>
_archiveFiles
(
File
outputFile
)
async
{
if
(
outputFile
.
path
.
toLowerCase
().
endsWith
(
'.zip'
))
{
await
_createZipArchive
(
outputFile
,
flutterRoot
);
}
else
if
(
outputFile
.
path
.
toLowerCase
().
endsWith
(
'.tar.xz'
))
{
...
...
@@ -454,7 +454,7 @@ class ArchivePublisher {
static
String
getMetadataFilename
(
Platform
platform
)
=>
'releases_
${platform.operatingSystem.toLowerCase()}
.json'
;
/// Publish the archive to Google Storage.
Future
<
Null
>
publishArchive
()
async
{
Future
<
void
>
publishArchive
()
async
{
final
String
destGsPath
=
'
$gsReleaseFolder
/
$destinationArchivePath
'
;
await
_cloudCopy
(
outputFile
.
absolute
.
path
,
destGsPath
);
assert
(
tempDir
.
existsSync
());
...
...
@@ -497,7 +497,7 @@ class ArchivePublisher {
return
jsonData
;
}
Future
<
Null
>
_updateMetadata
()
async
{
Future
<
void
>
_updateMetadata
()
async
{
// We can't just cat the metadata from the server with 'gsutil cat', because
// Windows wants to echo the commands that execute in gsutil.bat to the
// stdout when we do that. So, we copy the file locally and then read it
...
...
@@ -569,7 +569,7 @@ class ArchivePublisher {
///
/// Archives contain the executables and customizations for the platform that
/// they are created on.
Future
<
Null
>
main
(
List
<
String
>
argList
)
async
{
Future
<
void
>
main
(
List
<
String
>
argList
)
async
{
final
ArgParser
argParser
=
ArgParser
();
argParser
.
addOption
(
'temp_dir'
,
...
...
dev/bots/run_command.dart
View file @
d340e2f2
...
...
@@ -30,7 +30,7 @@ void printProgress(String action, String workingDir, String command) {
print
(
'
$arrow
$action
: cd
$cyan$workingDir$reset
;
$yellow$command$reset
'
);
}
Future
<
Null
>
runCommand
(
String
executable
,
List
<
String
>
arguments
,
{
Future
<
void
>
runCommand
(
String
executable
,
List
<
String
>
arguments
,
{
String
workingDirectory
,
Map
<
String
,
String
>
environment
,
bool
expectNonZeroExit
=
false
,
...
...
dev/bots/test.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:path/path.dart' as path;
import
'run_command.dart'
;
typedef
ShardRunner
=
Future
<
Null
>
Function
();
typedef
ShardRunner
=
Future
<
void
>
Function
();
final
String
flutterRoot
=
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
path
.
fromUri
(
Platform
.
script
))));
final
String
flutter
=
path
.
join
(
flutterRoot
,
'bin'
,
Platform
.
isWindows
?
'flutter.bat'
:
'flutter'
);
...
...
@@ -37,7 +37,7 @@ const Duration _kShortTimeout = Duration(minutes: 5);
/// For example:
/// SHARD=tool_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart
/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
flutterTestArgs
.
addAll
(
args
);
final
String
shard
=
Platform
.
environment
[
'SHARD'
];
...
...
@@ -58,7 +58,7 @@ Future<Null> main(List<String> args) async {
}
}
Future
<
Null
>
_runSmokeTests
()
async
{
Future
<
void
>
_runSmokeTests
()
async
{
// Verify that the tests actually return failure on failure and success on
// success.
final
String
automatedTests
=
path
.
join
(
flutterRoot
,
'dev'
,
'automated_tests'
);
...
...
@@ -138,7 +138,7 @@ Future<Null> _runSmokeTests() async {
await
_verifyVersion
(
path
.
join
(
flutterRoot
,
'version'
));
}
Future
<
Null
>
_runToolTests
()
async
{
Future
<
void
>
_runToolTests
()
async
{
await
_runSmokeTests
();
await
_pubRunTest
(
...
...
@@ -149,7 +149,7 @@ Future<Null> _runToolTests() async {
print
(
'
${bold}
DONE: All tests successful.
$reset
'
);
}
Future
<
Null
>
_runTests
()
async
{
Future
<
void
>
_runTests
()
async
{
await
_runSmokeTests
();
await
_runFlutterTest
(
path
.
join
(
flutterRoot
,
'packages'
,
'flutter'
));
...
...
@@ -171,7 +171,7 @@ Future<Null> _runTests() async {
print
(
'
${bold}
DONE: All tests successful.
$reset
'
);
}
Future
<
Null
>
_runCoverage
()
async
{
Future
<
void
>
_runCoverage
()
async
{
final
File
coverageFile
=
File
(
path
.
join
(
flutterRoot
,
'packages'
,
'flutter'
,
'coverage'
,
'lcov.info'
));
if
(!
coverageFile
.
existsSync
())
{
print
(
'
${red}
Coverage file not found.
$reset
'
);
...
...
@@ -193,7 +193,7 @@ Future<Null> _runCoverage() async {
print
(
'
${bold}
DONE: Coverage collection successful.
$reset
'
);
}
Future
<
Null
>
_pubRunTest
(
Future
<
void
>
_pubRunTest
(
String
workingDirectory
,
{
String
testPath
,
bool
enableFlutterToolAsserts
=
false
...
...
@@ -234,7 +234,7 @@ class EvalResult {
final
int
exitCode
;
}
Future
<
Null
>
_runFlutterTest
(
String
workingDirectory
,
{
Future
<
void
>
_runFlutterTest
(
String
workingDirectory
,
{
String
script
,
bool
expectFailure
=
false
,
bool
printOutput
=
true
,
...
...
@@ -268,7 +268,7 @@ Future<Null> _runFlutterTest(String workingDirectory, {
);
}
Future
<
Null
>
_verifyVersion
(
String
filename
)
async
{
Future
<
void
>
_verifyVersion
(
String
filename
)
async
{
if
(!
File
(
filename
).
existsSync
())
{
print
(
'
$redLine
'
);
print
(
'The version logic failed to create the Flutter version file.'
);
...
...
dev/devicelab/README.md
View file @
d340e2f2
...
...
@@ -177,7 +177,7 @@ import 'dart:async';
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
...
do
something
interesting
...
...
...
dev/devicelab/bin/run.dart
View file @
d340e2f2
...
...
@@ -19,7 +19,7 @@ List<String> _taskNames = <String>[];
///
/// The tasks are chosen depending on the command-line options
/// (see [_argParser]).
Future
<
Null
>
main
(
List
<
String
>
rawArgs
)
async
{
Future
<
void
>
main
(
List
<
String
>
rawArgs
)
async
{
ArgResults
args
;
try
{
args
=
_argParser
.
parse
(
rawArgs
);
...
...
dev/devicelab/bin/tasks/analyzer_benchmark.dart
View file @
d340e2f2
...
...
@@ -7,6 +7,6 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/analysis.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
analyzerBenchmarkTask
);
}
dev/devicelab/bin/tasks/android_sample_catalog_generator.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:flutter_devicelab/tasks/sample_catalog_generator.dart'
;
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(()
=>
samplePageCatalogGenerator
(
extractCloudAuthTokenArg
(
args
)));
}
dev/devicelab/bin/tasks/basic_material_app_android__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createBasicMaterialCompileTest
());
}
dev/devicelab/bin/tasks/basic_material_app_ios__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createBasicMaterialCompileTest
());
}
dev/devicelab/bin/tasks/basic_material_app_win__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createBasicMaterialCompileTest
());
}
dev/devicelab/bin/tasks/channels_integration_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createChannelsIntegrationTest
());
}
dev/devicelab/bin/tasks/channels_integration_test_ios.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createChannelsIntegrationTest
());
}
dev/devicelab/bin/tasks/channels_integration_test_win.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createChannelsIntegrationTest
());
}
dev/devicelab/bin/tasks/commands_test.dart
View file @
d340e2f2
...
...
@@ -21,7 +21,7 @@ void main() {
await
device
.
unlock
();
final
Directory
appDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'dev/integration_tests/ui'
));
await
inDirectory
(
appDir
,
()
async
{
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
bool
ok
;
print
(
'run: starting...'
);
final
Process
run
=
await
startProcess
(
...
...
@@ -107,7 +107,7 @@ class DriveHelper {
final
int
vmServicePort
;
Future
<
Null
>
drive
(
String
name
)
async
{
Future
<
void
>
drive
(
String
name
)
async
{
print
(
'drive: running commands_
$name
check...'
);
final
Process
drive
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
...
...
dev/devicelab/bin/tasks/complex_layout__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createComplexLayoutStartupTest
());
}
dev/devicelab/bin/tasks/complex_layout_android__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createComplexLayoutCompileTest
());
}
dev/devicelab/bin/tasks/complex_layout_ios__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createComplexLayoutCompileTest
());
}
dev/devicelab/bin/tasks/complex_layout_ios__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createComplexLayoutStartupTest
());
}
dev/devicelab/bin/tasks/complex_layout_scroll_perf__memory.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
MemoryTest
(
'
${flutterDirectory.path}
/dev/benchmarks/complex_layout'
,
...
...
dev/devicelab/bin/tasks/complex_layout_scroll_perf__timeline_summary.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createComplexLayoutScrollPerfTest
());
}
dev/devicelab/bin/tasks/complex_layout_scroll_perf_ios__timeline_summary.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createComplexLayoutScrollPerfTest
());
}
dev/devicelab/bin/tasks/complex_layout_win__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createComplexLayoutCompileTest
());
}
dev/devicelab/bin/tasks/dartdocs.dart
View file @
d340e2f2
...
...
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
final
Stopwatch
clock
=
Stopwatch
()..
start
();
final
Process
analysis
=
await
startProcess
(
...
...
dev/devicelab/bin/tasks/embedded_android_views_integration_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createEmbeddedAndroidViewsIntegrationTest
());
}
dev/devicelab/bin/tasks/external_ui_integration_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createExternalUiIntegrationTest
());
}
dev/devicelab/bin/tasks/external_ui_integration_test_ios.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createExternalUiIntegrationTest
());
}
dev/devicelab/bin/tasks/flavors_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlavorsTest
());
}
dev/devicelab/bin/tasks/flavors_test_ios.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createFlavorsTest
());
}
dev/devicelab/bin/tasks/flavors_test_win.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlavorsTest
());
}
dev/devicelab/bin/tasks/flutter_attach_test.dart
View file @
d340e2f2
...
...
@@ -13,11 +13,11 @@ import 'package:flutter_devicelab/framework/utils.dart';
Future
<
void
>
testReload
(
Process
process
,
{
Future
<
void
>
Function
()
onListening
})
async
{
section
(
'Testing hot reload, restart and quit'
);
final
Completer
<
Null
>
listening
=
Completer
<
Null
>();
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
Null
>
reloaded
=
Completer
<
Null
>();
final
Completer
<
Null
>
restarted
=
Completer
<
Null
>();
final
Completer
<
Null
>
finished
=
Completer
<
Null
>();
final
Completer
<
void
>
listening
=
Completer
<
void
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
final
Completer
<
void
>
reloaded
=
Completer
<
void
>();
final
Completer
<
void
>
restarted
=
Completer
<
void
>();
final
Completer
<
void
>
finished
=
Completer
<
void
>();
final
List
<
String
>
stdout
=
<
String
>[];
final
List
<
String
>
stderr
=
<
String
>[];
...
...
@@ -52,7 +52,7 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
process
.
exitCode
.
then
<
void
>((
int
processExitCode
)
{
exitCode
=
processExitCode
;
});
Future
<
dynamic
>
eventOrExit
(
Future
<
Null
>
event
)
{
Future
<
dynamic
>
eventOrExit
(
Future
<
void
>
event
)
{
return
Future
.
any
<
dynamic
>(<
Future
<
dynamic
>>[
event
,
process
.
exitCode
]);
}
...
...
@@ -116,7 +116,7 @@ void main() {
});
// Give the device the time to really shut down the app.
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
200
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
200
));
// After the delay, force-stopping it shouldn't do anything, but doesn't hurt.
await
device
.
shellExec
(
'am'
,
<
String
>[
'force-stop'
,
kAppId
]);
...
...
dev/devicelab/bin/tasks/flutter_gallery__back_button_memory.dart
View file @
d340e2f2
...
...
@@ -35,7 +35,7 @@ class BackButtonMemoryTest extends MemoryTest {
await
receivedNextMessage
;
// Give Android time to settle (e.g. run GCs) after closing the app.
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
100
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
100
));
// Relaunch the app, wait for it to launch.
prepareForNextMessage
(
'READY'
);
...
...
@@ -46,13 +46,13 @@ class BackButtonMemoryTest extends MemoryTest {
await
receivedNextMessage
;
// Wait for the Flutter app to settle (e.g. run GCs).
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
100
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
100
));
}
await
recordEnd
();
}
}
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
BackButtonMemoryTest
().
run
);
}
dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
MemoryTest
(
'
${flutterDirectory.path}
/examples/flutter_gallery'
,
'test_memory/memory_nav.dart'
,
...
...
dev/devicelab/bin/tasks/flutter_gallery__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlutterGalleryStartupTest
());
}
dev/devicelab/bin/tasks/flutter_gallery__transition_perf.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createGalleryTransitionTest
());
}
dev/devicelab/bin/tasks/flutter_gallery__transition_perf_with_semantics.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(()
async
{
final
TaskResult
withoutSemantics
=
await
createGalleryTransitionTest
()();
...
...
dev/devicelab/bin/tasks/flutter_gallery_android__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlutterGalleryCompileTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart
View file @
d340e2f2
...
...
@@ -13,7 +13,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
// with the Java code to report its status. If this test fails due to a problem on the Dart
// side, you can debug that by just running that file directly using `flutter run`.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(()
async
{
...
...
dev/devicelab/bin/tasks/flutter_gallery_ios32__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createFlutterGalleryStartupTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_ios32__transition_perf.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createGalleryTransitionTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_ios__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createFlutterGalleryCompileTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_ios__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createFlutterGalleryStartupTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_ios__transition_perf.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createGalleryTransitionTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_win__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlutterGalleryCompileTest
());
}
dev/devicelab/bin/tasks/flutter_view__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlutterViewStartupTest
());
}
dev/devicelab/bin/tasks/flutter_view_ios__start_up.dart
View file @
d340e2f2
...
...
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(()
async
{
final
Directory
iosDirectory
=
dir
(
...
...
dev/devicelab/bin/tasks/gradle_plugin_test.dart
View file @
d340e2f2
...
...
@@ -166,7 +166,7 @@ class FlutterProject {
String
get
rootPath
=>
path
.
join
(
parent
.
path
,
name
);
String
get
androidPath
=>
path
.
join
(
rootPath
,
'android'
);
Future
<
Null
>
addCustomBuildType
(
String
name
,
{
String
initWith
})
async
{
Future
<
void
>
addCustomBuildType
(
String
name
,
{
String
initWith
})
async
{
final
File
buildScript
=
File
(
path
.
join
(
androidPath
,
'app'
,
'build.gradle'
),
);
...
...
@@ -183,7 +183,7 @@ android {
'''
);
}
Future
<
Null
>
addProductFlavor
(
String
name
)
async
{
Future
<
void
>
addProductFlavor
(
String
name
)
async
{
final
File
buildScript
=
File
(
path
.
join
(
androidPath
,
'app'
,
'build.gradle'
),
);
...
...
@@ -202,14 +202,14 @@ android {
'''
);
}
Future
<
Null
>
introduceError
()
async
{
Future
<
void
>
introduceError
()
async
{
final
File
buildScript
=
File
(
path
.
join
(
androidPath
,
'app'
,
'build.gradle'
),
);
await
buildScript
.
writeAsString
((
await
buildScript
.
readAsString
()).
replaceAll
(
'buildTypes'
,
'builTypes'
));
}
Future
<
Null
>
runGradleTask
(
String
task
,
{
List
<
String
>
options
})
async
{
Future
<
void
>
runGradleTask
(
String
task
,
{
List
<
String
>
options
})
async
{
return
_runGradleTask
(
workingDirectory:
androidPath
,
task:
task
,
options:
options
);
}
...
...
@@ -244,14 +244,14 @@ class FlutterPluginProject {
String
get
exampleAndroidPath
=>
path
.
join
(
examplePath
,
'android'
);
String
get
debugApkPath
=>
path
.
join
(
examplePath
,
'build'
,
'app'
,
'outputs'
,
'apk'
,
'debug'
,
'app-debug.apk'
);
Future
<
Null
>
runGradleTask
(
String
task
,
{
List
<
String
>
options
})
async
{
Future
<
void
>
runGradleTask
(
String
task
,
{
List
<
String
>
options
})
async
{
return
_runGradleTask
(
workingDirectory:
exampleAndroidPath
,
task:
task
,
options:
options
);
}
bool
get
hasDebugApk
=>
File
(
debugApkPath
).
existsSync
();
}
Future
<
Null
>
_runGradleTask
({
String
workingDirectory
,
String
task
,
List
<
String
>
options
})
async
{
Future
<
void
>
_runGradleTask
({
String
workingDirectory
,
String
task
,
List
<
String
>
options
})
async
{
final
ProcessResult
result
=
await
_resultOfGradleTask
(
workingDirectory:
workingDirectory
,
task:
task
,
...
...
dev/devicelab/bin/tasks/hello_world__memory.dart
View file @
d340e2f2
...
...
@@ -27,13 +27,13 @@ class HelloWorldMemoryTest extends MemoryTest {
'-d'
,
device
.
deviceId
,
test
,
]);
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
1500
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
1500
));
await
recordStart
();
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
3000
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
3000
));
await
recordEnd
();
}
}
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
HelloWorldMemoryTest
().
run
);
}
dev/devicelab/bin/tasks/hello_world_android__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createHelloWorldCompileTest
());
}
dev/devicelab/bin/tasks/hello_world_ios__compile.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createHelloWorldCompileTest
());
}
dev/devicelab/bin/tasks/hot_mode_dev_cycle__benchmark.dart
View file @
d340e2f2
...
...
@@ -7,6 +7,6 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/hot_mode_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
createHotModeTest
());
}
dev/devicelab/bin/tasks/hot_mode_dev_cycle_linux__benchmark.dart
View file @
d340e2f2
...
...
@@ -7,6 +7,6 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/hot_mode_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
createHotModeTest
());
}
dev/devicelab/bin/tasks/hot_mode_dev_cycle_win__benchmark.dart
View file @
d340e2f2
...
...
@@ -7,6 +7,6 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/hot_mode_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
createHotModeTest
());
}
dev/devicelab/bin/tasks/integration_ui.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
/// End to end tests for Android.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
runEndToEndTests
);
}
dev/devicelab/bin/tasks/integration_ui_ios.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
/// End to end tests for iOS.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
runEndToEndTests
);
}
dev/devicelab/bin/tasks/ios_sample_catalog_generator.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:flutter_devicelab/tasks/sample_catalog_generator.dart'
;
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(()
=>
samplePageCatalogGenerator
(
extractCloudAuthTokenArg
(
args
)));
}
dev/devicelab/bin/tasks/microbenchmarks.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/tasks/microbenchmarks.dart'
;
/// Runs microbenchmarks on Android.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createMicrobenchmarkTask
());
}
dev/devicelab/bin/tasks/microbenchmarks_ios.dart
View file @
d340e2f2
...
...
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/tasks/microbenchmarks.dart'
;
/// Runs microbenchmarks on iOS.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createMicrobenchmarkTask
());
}
dev/devicelab/bin/tasks/module_test.dart
View file @
d340e2f2
...
...
@@ -11,7 +11,7 @@ import 'package:path/path.dart' as path;
/// Tests that the Flutter module project template works and supports
/// adding Flutter to an existing Android app.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
section
(
'Find Java'
);
...
...
dev/devicelab/bin/tasks/module_test_ios.dart
View file @
d340e2f2
...
...
@@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
/// Tests that the Flutter module project template works and supports
/// adding Flutter to an existing iOS app.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
section
(
'Create Flutter module project'
);
...
...
dev/devicelab/bin/tasks/platform_channel_sample_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createPlatformChannelSampleTest
());
}
dev/devicelab/bin/tasks/platform_channel_sample_test_ios.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createPlatformChannelSampleTest
());
}
dev/devicelab/bin/tasks/platform_interaction_test.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createPlatformInteractionTest
());
}
dev/devicelab/bin/tasks/platform_interaction_test_ios.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/integration_tests.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createPlatformInteractionTest
());
}
dev/devicelab/bin/tasks/platform_view__start_up.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createPlatformViewStartupTest
());
}
dev/devicelab/bin/tasks/platform_view_ios__start_up.dart
View file @
d340e2f2
...
...
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(()
async
{
final
Directory
iosDirectory
=
dir
(
...
...
dev/devicelab/bin/tasks/plugin_test.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/plugin_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
combine
(<
TaskFunction
>[
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'java'
]),
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'kotlin'
]),
...
...
dev/devicelab/bin/tasks/plugin_test_ios.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/plugin_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
combine
(<
TaskFunction
>[
PluginTest
(
'ios'
,
<
String
>[
'-i'
,
'objc'
]),
PluginTest
(
'ios'
,
<
String
>[
'-i'
,
'swift'
]),
...
...
dev/devicelab/bin/tasks/plugin_test_win.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/tasks/plugin_tests.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(
combine
(<
TaskFunction
>[
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'java'
]),
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'kotlin'
]),
...
...
dev/devicelab/bin/tasks/routing_test.dart
View file @
d340e2f2
...
...
@@ -29,7 +29,7 @@ void main() {
});
section
(
'TEST WHETHER `flutter run --route` WORKS'
);
await
inDirectory
(
appDir
,
()
async
{
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
bool
ok
;
print
(
'run: starting...'
);
final
Process
run
=
await
startProcess
(
...
...
dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart
View file @
d340e2f2
...
...
@@ -39,7 +39,7 @@ void main() {
final
Directory
appDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'dev/integration_tests/ui'
));
await
inDirectory
(
appDir
,
()
async
{
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
bool
ok
;
print
(
'run: starting...'
);
final
Process
run
=
await
startProcess
(
...
...
dev/devicelab/bin/tasks/run_release_test.dart
View file @
d340e2f2
...
...
@@ -18,7 +18,7 @@ void main() {
await
device
.
unlock
();
final
Directory
appDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'dev/integration_tests/ui'
));
await
inDirectory
(
appDir
,
()
async
{
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
print
(
'run: starting...'
);
final
Process
run
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
...
...
dev/devicelab/bin/tasks/service_extensions_test.dart
View file @
d340e2f2
...
...
@@ -21,7 +21,7 @@ void main() {
await
device
.
unlock
();
final
Directory
appDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'dev/integration_tests/ui'
));
await
inDirectory
(
appDir
,
()
async
{
final
Completer
<
Null
>
ready
=
Completer
<
Null
>();
final
Completer
<
void
>
ready
=
Completer
<
void
>();
bool
ok
;
print
(
'run: starting...'
);
final
Process
run
=
await
startProcess
(
...
...
dev/devicelab/bin/tasks/smoke_test_failure.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/framework/framework.dart'
;
/// Smoke test of a task that fails by returning an unsuccessful response.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
return
TaskResult
.
failure
(
'Failed'
);
});
...
...
dev/devicelab/bin/tasks/smoke_test_setup_failure.dart
View file @
d340e2f2
...
...
@@ -10,4 +10,4 @@ import 'dart:async';
/// therefore will not accept requests to run tasks. When the runner attempts to
/// connect and run the test it will receive a "method not found" error from the
/// VM service, will likely retry and finally time out.
Future
<
Null
>
main
()
async
{}
Future
<
void
>
main
()
async
{}
dev/devicelab/bin/tasks/smoke_test_success.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/framework/framework.dart'
;
/// Smoke test of a successful task.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
return
TaskResult
.
success
(<
String
,
dynamic
>{});
});
...
...
dev/devicelab/bin/tasks/smoke_test_throws.dart
View file @
d340e2f2
...
...
@@ -7,7 +7,7 @@ import 'dart:async';
import
'package:flutter_devicelab/framework/framework.dart'
;
/// Smoke test of a task that fails with an exception.
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
throw
'failed'
;
});
...
...
dev/devicelab/bin/tasks/technical_debt__cost.dart
View file @
d340e2f2
...
...
@@ -76,7 +76,7 @@ Future<int> countDependencies() async {
const
String
_kCostBenchmarkKey
=
'technical_debt_in_dollars'
;
const
String
_kNumberOfDependenciesKey
=
'dependencies_count'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
await
task
(()
async
{
return
TaskResult
.
success
(
<
String
,
dynamic
>{
...
...
dev/devicelab/bin/tasks/tiles_scroll_perf__timeline_summary.dart
View file @
d340e2f2
...
...
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createTilesScrollPerfTest
());
}
...
...
dev/devicelab/lib/framework/adb.dart
View file @
d340e2f2
...
...
@@ -39,7 +39,7 @@ abstract class DeviceDiscovery {
///
/// Calling this method does not guarantee that the same device will be
/// returned. For such behavior see [workingDevice].
Future
<
Null
>
chooseWorkingDevice
();
Future
<
void
>
chooseWorkingDevice
();
/// A device to work with.
///
...
...
@@ -55,7 +55,7 @@ abstract class DeviceDiscovery {
Future
<
Map
<
String
,
HealthCheckResult
>>
checkDevices
();
/// Prepares the system to run tasks.
Future
<
Null
>
performPreflightTasks
();
Future
<
void
>
performPreflightTasks
();
}
/// A proxy for one specific device.
...
...
@@ -70,21 +70,21 @@ abstract class Device {
Future
<
bool
>
isAsleep
();
/// Wake up the device if it is not awake.
Future
<
Null
>
wakeUp
();
Future
<
void
>
wakeUp
();
/// Send the device to sleep mode.
Future
<
Null
>
sendToSleep
();
Future
<
void
>
sendToSleep
();
/// Emulates pressing the power button, toggling the device's on/off state.
Future
<
Null
>
togglePower
();
Future
<
void
>
togglePower
();
/// Unlocks the device.
///
/// Assumes the device doesn't have a secure unlock pattern.
Future
<
Null
>
unlock
();
Future
<
void
>
unlock
();
/// Emulate a tap on the touch screen.
Future
<
Null
>
tap
(
int
x
,
int
y
);
Future
<
void
>
tap
(
int
x
,
int
y
);
/// Read memory statistics for a process.
Future
<
Map
<
String
,
dynamic
>>
getMemoryStats
(
String
packageName
);
...
...
@@ -96,7 +96,7 @@ abstract class Device {
Stream
<
String
>
get
logcat
;
/// Stop a process.
Future
<
Null
>
stop
(
String
packageName
);
Future
<
void
>
stop
(
String
packageName
);
}
class
AndroidDeviceDiscovery
implements
DeviceDiscovery
{
...
...
@@ -127,7 +127,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
/// Picks a random Android device out of connected devices and sets it as
/// [workingDevice].
@override
Future
<
Null
>
chooseWorkingDevice
()
async
{
Future
<
void
>
chooseWorkingDevice
()
async
{
final
List
<
Device
>
allDevices
=
(
await
discoverDevices
())
.
map
<
Device
>((
String
id
)
=>
AndroidDevice
(
deviceId:
id
))
.
toList
();
...
...
@@ -187,7 +187,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
}
@override
Future
<
Null
>
performPreflightTasks
()
async
{
Future
<
void
>
performPreflightTasks
()
async
{
// Kills the `adb` server causing it to start a new instance upon next
// command.
//
...
...
@@ -218,14 +218,14 @@ class AndroidDevice implements Device {
/// Wake up the device if it is not awake using [togglePower].
@override
Future
<
Null
>
wakeUp
()
async
{
Future
<
void
>
wakeUp
()
async
{
if
(!(
await
isAwake
()))
await
togglePower
();
}
/// Send the device to sleep mode if it is not asleep using [togglePower].
@override
Future
<
Null
>
sendToSleep
()
async
{
Future
<
void
>
sendToSleep
()
async
{
if
(!(
await
isAsleep
()))
await
togglePower
();
}
...
...
@@ -233,7 +233,7 @@ class AndroidDevice implements Device {
/// Sends `KEYCODE_POWER` (26), which causes the device to toggle its mode
/// between awake and asleep.
@override
Future
<
Null
>
togglePower
()
async
{
Future
<
void
>
togglePower
()
async
{
await
shellExec
(
'input'
,
const
<
String
>[
'keyevent'
,
'26'
]);
}
...
...
@@ -241,13 +241,13 @@ class AndroidDevice implements Device {
///
/// This only works when the device doesn't have a secure unlock pattern.
@override
Future
<
Null
>
unlock
()
async
{
Future
<
void
>
unlock
()
async
{
await
wakeUp
();
await
shellExec
(
'input'
,
const
<
String
>[
'keyevent'
,
'82'
]);
}
@override
Future
<
Null
>
tap
(
int
x
,
int
y
)
async
{
Future
<
void
>
tap
(
int
x
,
int
y
)
async
{
await
shellExec
(
'input'
,
<
String
>[
'tap'
,
'
$x
'
,
'
$y
'
]);
}
...
...
@@ -261,7 +261,7 @@ class AndroidDevice implements Device {
}
/// Executes [command] on `adb shell` and returns its exit code.
Future
<
Null
>
shellExec
(
String
command
,
List
<
String
>
arguments
,
{
Map
<
String
,
String
>
environment
})
async
{
Future
<
void
>
shellExec
(
String
command
,
List
<
String
>
arguments
,
{
Map
<
String
,
String
>
environment
})
async
{
await
adb
(<
String
>[
'shell'
,
command
]..
addAll
(
arguments
),
environment:
environment
);
}
...
...
@@ -343,7 +343,7 @@ class AndroidDevice implements Device {
}
@override
Future
<
Null
>
stop
(
String
packageName
)
async
{
Future
<
void
>
stop
(
String
packageName
)
async
{
return
shellExec
(
'am'
,
<
String
>[
'force-stop'
,
packageName
]);
}
}
...
...
@@ -371,7 +371,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
/// Picks a random iOS device out of connected devices and sets it as
/// [workingDevice].
@override
Future
<
Null
>
chooseWorkingDevice
()
async
{
Future
<
void
>
chooseWorkingDevice
()
async
{
final
List
<
IosDevice
>
allDevices
=
(
await
discoverDevices
())
.
map
<
IosDevice
>((
String
id
)
=>
IosDevice
(
deviceId:
id
))
.
toList
();
...
...
@@ -405,7 +405,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
}
@override
Future
<
Null
>
performPreflightTasks
()
async
{
Future
<
void
>
performPreflightTasks
()
async
{
// Currently we do not have preflight tasks for iOS.
return
null
;
}
...
...
@@ -430,19 +430,19 @@ class IosDevice implements Device {
Future
<
bool
>
isAsleep
()
async
=>
false
;
@override
Future
<
Null
>
wakeUp
()
async
{}
Future
<
void
>
wakeUp
()
async
{}
@override
Future
<
Null
>
sendToSleep
()
async
{}
Future
<
void
>
sendToSleep
()
async
{}
@override
Future
<
Null
>
togglePower
()
async
{}
Future
<
void
>
togglePower
()
async
{}
@override
Future
<
Null
>
unlock
()
async
{}
Future
<
void
>
unlock
()
async
{}
@override
Future
<
Null
>
tap
(
int
x
,
int
y
)
async
{
Future
<
void
>
tap
(
int
x
,
int
y
)
async
{
throw
'Not implemented'
;
}
...
...
@@ -457,7 +457,7 @@ class IosDevice implements Device {
}
@override
Future
<
Null
>
stop
(
String
packageName
)
async
{}
Future
<
void
>
stop
(
String
packageName
)
async
{}
}
/// Path to the `adb` executable.
...
...
dev/devicelab/lib/framework/ios.dart
View file @
d340e2f2
...
...
@@ -19,7 +19,7 @@ const FileSystem _fs = io.LocalFileSystem();
/// information required to build and run the project, if
/// FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG is set. If it is not set,
/// we rely on automatic signing by Xcode.
Future
<
Null
>
prepareProvisioningCertificates
(
String
flutterProjectPath
)
async
{
Future
<
void
>
prepareProvisioningCertificates
(
String
flutterProjectPath
)
async
{
final
String
certificateConfig
=
await
_readProvisioningConfigFile
();
if
(
certificateConfig
==
null
)
{
// No cert config available, rely on automatic signing by Xcode.
...
...
@@ -31,12 +31,12 @@ Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
await
testXcconfig
.
writeAsString
(
certificateConfig
);
}
Future
<
Null
>
runPodInstallForCustomPodfile
(
String
flutterProjectPath
)
async
{
Future
<
void
>
runPodInstallForCustomPodfile
(
String
flutterProjectPath
)
async
{
final
String
iosPath
=
path
.
join
(
flutterProjectPath
,
'ios'
);
exec
(
'pod'
,
<
String
>[
'install'
,
'--project-directory=
$iosPath
'
]);
}
Future
<
Null
>
_patchXcconfigFilesIfNotPatched
(
String
flutterProjectPath
)
async
{
Future
<
void
>
_patchXcconfigFilesIfNotPatched
(
String
flutterProjectPath
)
async
{
final
List
<
File
>
xcconfigFiles
=
<
File
>[
_fs
.
file
(
path
.
join
(
flutterProjectPath
,
'ios/Flutter/Flutter.xcconfig'
)),
_fs
.
file
(
path
.
join
(
flutterProjectPath
,
'ios/Flutter/Debug.xcconfig'
)),
...
...
dev/devicelab/lib/framework/runner.dart
View file @
d340e2f2
...
...
@@ -97,7 +97,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
// delay to let the task process open up the VM service port.
// Otherwise we almost always hit the non-ready case first and
// wait a whole 1 second, which is annoying.
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
100
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
100
));
while
(
true
)
{
try
{
...
...
@@ -123,7 +123,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
print
(
'VM service not ready yet:
$error
'
);
const
Duration
pauseBetweenRetries
=
Duration
(
milliseconds:
200
);
print
(
'Will retry in
$pauseBetweenRetries
.'
);
await
Future
<
Null
>.
delayed
(
pauseBetweenRetries
);
await
Future
<
void
>.
delayed
(
pauseBetweenRetries
);
}
}
}
...
...
dev/devicelab/lib/framework/utils.dart
View file @
d340e2f2
...
...
@@ -243,12 +243,12 @@ Future<Process> startProcess(
return
process
;
}
Future
<
Null
>
forceQuitRunningProcesses
()
async
{
Future
<
void
>
forceQuitRunningProcesses
()
async
{
if
(
_runningProcesses
.
isEmpty
)
return
;
// Give normally quitting processes a chance to report their exit code.
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
// Whatever's left, kill it.
for
(
ProcessInfo
p
in
_runningProcesses
)
{
...
...
@@ -270,8 +270,8 @@ Future<int> exec(
})
async
{
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
,
workingDirectory:
workingDirectory
);
final
Completer
<
Null
>
stdoutDone
=
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
Completer
<
Null
>();
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
@@ -285,7 +285,7 @@ Future<int> exec(
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
Future
.
wait
<
void
>(<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
...
...
@@ -307,8 +307,8 @@ Future<String> eval(
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
,
workingDirectory:
workingDirectory
);
final
StringBuffer
output
=
StringBuffer
();
final
Completer
<
Null
>
stdoutDone
=
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
Completer
<
Null
>();
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
@@ -323,7 +323,7 @@ Future<String> eval(
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
Future
.
wait
<
void
>(<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
...
...
@@ -420,7 +420,7 @@ String jsonEncode(dynamic data) {
return
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
data
)
+
'
\n
'
;
}
Future
<
Null
>
getFlutter
(
String
revision
)
async
{
Future
<
void
>
getFlutter
(
String
revision
)
async
{
section
(
'Get Flutter!'
);
if
(
exists
(
flutterDirectory
))
{
...
...
@@ -495,8 +495,8 @@ Iterable<String> grep(Pattern pattern, {@required String from}) {
/// } catch (error, chain) {
///
/// }
Future
<
Null
>
runAndCaptureAsyncStacks
(
Future
<
Null
>
callback
())
{
final
Completer
<
Null
>
completer
=
Completer
<
Null
>();
Future
<
void
>
runAndCaptureAsyncStacks
(
Future
<
void
>
callback
())
{
final
Completer
<
void
>
completer
=
Completer
<
void
>();
Chain
.
capture
(()
async
{
await
callback
();
completer
.
complete
();
...
...
dev/devicelab/lib/tasks/hot_mode_tests.dart
View file @
d340e2f2
...
...
@@ -43,8 +43,8 @@ TaskFunction createHotModeTest() {
environment:
null
);
final
Completer
<
Null
>
stdoutDone
=
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
Completer
<
Null
>();
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
@@ -80,8 +80,8 @@ TaskFunction createHotModeTest() {
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(
<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
Future
.
wait
<
void
>(
<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
process
.
exitCode
;
twoReloadsData
=
json
.
decode
(
benchmarkFile
.
readAsStringSync
());
...
...
@@ -96,8 +96,8 @@ TaskFunction createHotModeTest() {
<
String
>[
'run'
]..
addAll
(
options
),
environment:
null
);
final
Completer
<
Null
>
stdoutDone
=
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
Completer
<
Null
>();
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
@@ -118,8 +118,8 @@ TaskFunction createHotModeTest() {
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(
<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
Future
.
wait
<
void
>(
<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
await
process
.
exitCode
;
freshRestartReloadsData
=
...
...
dev/devicelab/lib/tasks/plugin_tests.dart
View file @
d340e2f2
...
...
@@ -73,7 +73,7 @@ class FlutterProject {
String
get
rootPath
=>
path
.
join
(
parent
.
path
,
name
);
Future
<
Null
>
addPlugin
(
String
plugin
)
async
{
Future
<
void
>
addPlugin
(
String
plugin
)
async
{
final
File
pubspec
=
File
(
path
.
join
(
rootPath
,
'pubspec.yaml'
));
String
content
=
await
pubspec
.
readAsString
();
content
=
content
.
replaceFirst
(
...
...
@@ -83,13 +83,13 @@ class FlutterProject {
await
pubspec
.
writeAsString
(
content
,
flush:
true
);
}
Future
<
Null
>
build
(
String
target
)
async
{
Future
<
void
>
build
(
String
target
)
async
{
await
inDirectory
(
Directory
(
rootPath
),
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
target
]);
});
}
Future
<
Null
>
delete
()
async
{
Future
<
void
>
delete
()
async
{
if
(
Platform
.
isWindows
)
{
// A running Gradle daemon might prevent us from deleting the project
// folder on Windows.
...
...
@@ -99,7 +99,7 @@ class FlutterProject {
canFail:
true
,
);
// TODO(ianh): Investigating if flakiness is timing dependent.
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
10
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
10
));
}
rmTree
(
parent
);
}
...
...
dev/devicelab/lib/tasks/save_catalog_screenshots.dart
View file @
d340e2f2
...
...
@@ -61,7 +61,7 @@ class Upload {
final
HttpClientResponse
response
=
await
request
.
close
().
timeout
(
timeLimit
);
if
(
response
.
statusCode
==
HttpStatus
.
ok
)
{
logMessage
(
'Saved
$name
'
);
await
response
.
drain
<
Null
>();
await
response
.
drain
<
void
>();
}
else
{
// TODO(hansmuller): only retry on 5xx and 429 responses
logMessage
(
'Request to save "
$name
" (length
${content.length}
) failed with status
${response.statusCode}
, will retry'
);
...
...
@@ -93,7 +93,7 @@ class Upload {
static
bool
isNotComplete
(
Upload
upload
)
=>
!
upload
.
isComplete
;
}
Future
<
Null
>
saveScreenshots
(
List
<
String
>
fromPaths
,
List
<
String
>
largeNames
,
List
<
String
>
smallNames
)
async
{
Future
<
void
>
saveScreenshots
(
List
<
String
>
fromPaths
,
List
<
String
>
largeNames
,
List
<
String
>
smallNames
)
async
{
assert
(
fromPaths
.
length
==
largeNames
.
length
);
assert
(
fromPaths
.
length
==
smallNames
.
length
);
...
...
@@ -113,7 +113,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
// If path is lib/foo.png then screenshotName is foo.
String
screenshotName
(
String
path
)
=>
basenameWithoutExtension
(
path
);
Future
<
Null
>
saveCatalogScreenshots
({
Future
<
void
>
saveCatalogScreenshots
({
Directory
directory
,
// Where the *.png screenshots are.
String
commit
,
// The commit hash to be used as a cloud storage "directory".
String
token
,
// Cloud storage authorization token.
...
...
dev/devicelab/test/adb_test.dart
View file @
d340e2f2
...
...
@@ -192,7 +192,7 @@ class FakeDevice extends AndroidDevice {
}
@override
Future
<
Null
>
shellExec
(
String
command
,
List
<
String
>
arguments
,
{
Map
<
String
,
String
>
environment
})
async
{
Future
<
void
>
shellExec
(
String
command
,
List
<
String
>
arguments
,
{
Map
<
String
,
String
>
environment
})
async
{
commandLog
.
add
(
CommandArgs
(
command:
command
,
arguments:
arguments
,
...
...
dev/integration_tests/external_ui/lib/main.dart
View file @
d340e2f2
...
...
@@ -30,7 +30,7 @@ class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
IconData
_icon
;
double
_flutterFrameRate
;
Future
<
Null
>
_summarizeStats
()
async
{
Future
<
void
>
_summarizeStats
()
async
{
final
double
framesProduced
=
await
channel
.
invokeMethod
(
'getProducedFrameRate'
);
final
double
framesConsumed
=
await
channel
.
invokeMethod
(
'getConsumedFrameRate'
);
_summary
=
'''
...
...
@@ -39,7 +39,7 @@ Consumed: ${framesConsumed.toStringAsFixed(1)}fps
Widget builds:
$_widgetBuilds
'''
;
}
Future
<
Null
>
_nextState
()
async
{
Future
<
void
>
_nextState
()
async
{
switch
(
_state
)
{
case
FrameState
.
initial
:
debugPrint
(
'Starting .5x speed test...'
);
...
...
@@ -90,9 +90,9 @@ Widget builds: $_widgetBuilds''';
static
const
int
calibrationTickCount
=
600
;
/// Measures Flutter's frame rate.
Future
<
Null
>
_calibrate
()
async
{
Future
<
void
>
_calibrate
()
async
{
debugPrint
(
'Awaiting calm (3 second pause)...'
);
await
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
3000
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
3000
));
debugPrint
(
'Calibrating...'
);
DateTime
startTime
;
int
tickCount
=
0
;
...
...
dev/integration_tests/external_ui/test_driver/main_test.dart
View file @
d340e2f2
...
...
@@ -11,7 +11,7 @@ final RegExp calibrationRegExp = RegExp('Flutter frame rate is (.*)fps');
final
RegExp
statsRegExp
=
RegExp
(
'Produced: (.*)fps
\n
Consumed: (.*)fps
\n
Widget builds: (.*)'
);
const
Duration
samplingTime
=
Duration
(
seconds:
8
);
Future
<
Null
>
main
()
async
{
Future
<
void
>
main
()
async
{
group
(
'texture suite'
,
()
{
FlutterDriver
driver
;
...
...
@@ -38,7 +38,7 @@ Future<Null> main() async {
// Texture frame stats at 0.5x Flutter frame rate
await
driver
.
tap
(
fab
);
await
Future
<
Null
>.
delayed
(
samplingTime
);
await
Future
<
void
>.
delayed
(
samplingTime
);
await
driver
.
tap
(
fab
);
final
String
statsSlow
=
await
driver
.
getText
(
summary
);
...
...
@@ -50,7 +50,7 @@ Future<Null> main() async {
// Texture frame stats at 2.0x Flutter frame rate
await
driver
.
tap
(
fab
);
await
Future
<
Null
>.
delayed
(
samplingTime
);
await
Future
<
void
>.
delayed
(
samplingTime
);
await
driver
.
tap
(
fab
);
final
String
statsFast
=
await
driver
.
getText
(
summary
);
...
...
dev/integration_tests/ui/test_driver/driver_test.dart
View file @
d340e2f2
...
...
@@ -36,14 +36,14 @@ void main() {
test
(
'waitForAbsent should resolve when text "present" disappears'
,
()
async
{
// Begin waiting for it to disappear
final
Completer
<
Null
>
whenWaitForAbsentResolves
=
Completer
<
Null
>();
final
Completer
<
void
>
whenWaitForAbsentResolves
=
Completer
<
void
>();
driver
.
waitForAbsent
(
presentText
).
then
(
whenWaitForAbsentResolves
.
complete
,
onError:
whenWaitForAbsentResolves
.
completeError
,
);
// Wait 1 second then make it disappear
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
await
driver
.
tap
(
find
.
byValueKey
(
'togglePresent'
));
// Ensure waitForAbsent resolves
...
...
@@ -61,14 +61,14 @@ void main() {
test
(
'waitFor should resolve when text "present" reappears'
,
()
async
{
// Begin waiting for it to reappear
final
Completer
<
Null
>
whenWaitForResolves
=
Completer
<
Null
>();
final
Completer
<
void
>
whenWaitForResolves
=
Completer
<
void
>();
driver
.
waitFor
(
presentText
).
then
(
whenWaitForResolves
.
complete
,
onError:
whenWaitForResolves
.
completeError
,
);
// Wait 1 second then make it appear
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
await
driver
.
tap
(
find
.
byValueKey
(
'togglePresent'
));
// Ensure waitFor resolves
...
...
dev/integration_tests/ui/test_driver/keyboard_resize_test.dart
View file @
d340e2f2
...
...
@@ -33,7 +33,7 @@ void main() {
final
SerializableFinder
defaultTextField
=
find
.
byValueKey
(
keys
.
kDefaultTextField
);
await
driver
.
waitFor
(
defaultTextField
);
await
driver
.
tap
(
defaultTextField
);
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
// Measure the height with keyboard displayed.
final
String
heightWithKeyboardShown
=
await
driver
.
getText
(
heightText
);
...
...
@@ -43,7 +43,7 @@ void main() {
final
SerializableFinder
unfocusButton
=
find
.
byValueKey
(
keys
.
kUnfocusButton
);
await
driver
.
waitFor
(
unfocusButton
);
await
driver
.
tap
(
unfocusButton
);
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
// Measure the final height.
final
String
endHeight
=
await
driver
.
getText
(
heightText
);
...
...
dev/integration_tests/ui/test_driver/keyboard_textfield_test.dart
View file @
d340e2f2
...
...
@@ -41,7 +41,7 @@ void main() {
// Bring up keyboard
await
driver
.
tap
(
textFieldFinder
);
await
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
// Ensure that TextField is visible again
await
driver
.
waitFor
(
textFieldFinder
);
...
...
dev/manual_tests/lib/material_arc.dart
View file @
d340e2f2
...
...
@@ -438,7 +438,7 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
];
}
Future
<
Null
>
_play
(
_ArcDemo
demo
)
async
{
Future
<
void
>
_play
(
_ArcDemo
demo
)
async
{
await
demo
.
controller
.
forward
();
if
(
demo
.
key
.
currentState
!=
null
&&
demo
.
key
.
currentState
.
mounted
)
demo
.
controller
.
reverse
();
...
...
dev/tools/dartdoc.dart
View file @
d340e2f2
...
...
@@ -25,7 +25,7 @@ const String kDocRoot = 'dev/docs/doc';
/// in your path. It requires that 'flutter' has been run previously. It uses
/// the version of Dart downloaded by the 'flutter' tool in this repository and
/// will crash if that is absent.
Future
<
Null
>
main
(
List
<
String
>
arguments
)
async
{
Future
<
void
>
main
(
List
<
String
>
arguments
)
async
{
final
ArgParser
argParser
=
_createArgsParser
();
final
ArgResults
args
=
argParser
.
parse
(
arguments
);
if
(
args
[
'help'
])
{
...
...
dev/tools/gen_date_localizations.dart
View file @
d340e2f2
...
...
@@ -36,7 +36,7 @@ import 'localizations_utils.dart';
const
String
_kCommandName
=
'gen_date_localizations.dart'
;
Future
<
Null
>
main
(
List
<
String
>
rawArgs
)
async
{
Future
<
void
>
main
(
List
<
String
>
rawArgs
)
async
{
checkCwdIsRepoRoot
(
_kCommandName
);
final
bool
writeToFile
=
parseArgs
(
rawArgs
).
writeToFile
;
...
...
dev/tools/java_and_objc_doc.dart
View file @
d340e2f2
...
...
@@ -12,7 +12,7 @@ const String kDocRoot = 'dev/docs/doc';
/// This script downloads an archive of Javadoc and objc doc for the engine from
/// the artifact store and extracts them to the location used for Dartdoc.
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
final
String
engineVersion
=
File
(
'bin/internal/engine.version'
).
readAsStringSync
().
trim
();
final
String
javadocUrl
=
'https://storage.googleapis.com/flutter_infra/flutter/
$engineVersion
/android-javadoc.zip'
;
...
...
@@ -22,7 +22,7 @@ Future<Null> main(List<String> args) async {
generateDocs
(
objcdocUrl
,
'objcdoc'
,
'Classes/FlutterViewController.html'
);
}
Future
<
Null
>
generateDocs
(
String
url
,
String
docName
,
String
checkFile
)
async
{
Future
<
void
>
generateDocs
(
String
url
,
String
docName
,
String
checkFile
)
async
{
final
http
.
Response
response
=
await
http
.
get
(
url
);
final
Archive
archive
=
ZipDecoder
().
decodeBytes
(
response
.
bodyBytes
);
...
...
dev/tools/vitool/lib/vitool.dart
View file @
d340e2f2
...
...
@@ -386,7 +386,7 @@ class SvgPathCommand {
}
class
SvgPathCommandBuilder
{
static
const
Map
<
String
,
Null
>
kRelativeCommands
=
<
String
,
Null
>
{
static
const
Map
<
String
,
void
>
kRelativeCommands
=
<
String
,
void
>
{
'c'
:
null
,
'l'
:
null
,
'm'
:
null
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment