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
36c5e321
Unverified
Commit
36c5e321
authored
Feb 05, 2019
by
xster
Committed by
GitHub
Feb 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print 50000$ monopoly money (#27531)
parent
9abe4c6d
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
114 additions
and
78 deletions
+114
-78
android_workflow.dart
packages/flutter_tools/lib/src/android/android_workflow.dart
+1
-1
common.dart
packages/flutter_tools/lib/src/base/common.dart
+11
-0
process.dart
packages/flutter_tools/lib/src/base/process.dart
+2
-1
analyze_once.dart
packages/flutter_tools/lib/src/commands/analyze_once.dart
+2
-2
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+14
-13
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+2
-2
analysis.dart
packages/flutter_tools/lib/src/dart/analysis.dart
+2
-1
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+2
-1
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+2
-2
code_signing.dart
packages/flutter_tools/lib/src/ios/code_signing.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+2
-2
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+3
-2
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+26
-18
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+6
-6
flutter_tester.dart
packages/flutter_tools/lib/src/tester/flutter_tester.dart
+1
-1
compile_test.dart
packages/flutter_tools/test/compile_test.dart
+26
-17
hot_reload_test.dart
packages/flutter_tools/test/integration/hot_reload_test.dart
+3
-2
test_driver.dart
packages/flutter_tools/test/integration/test_driver.dart
+3
-2
daemon_client.dart
packages/flutter_tools/tool/daemon_client.dart
+4
-3
No files found.
packages/flutter_tools/lib/src/android/android_workflow.dart
View file @
36c5e321
...
...
@@ -294,7 +294,7 @@ class AndroidLicenseValidator extends DoctorValidator {
// The real stdin will never finish streaming. Pipe until the child process
// finishes.
process
.
stdin
.
addStream
(
stdin
);
// ignore: unawaited_futures
unawaited
(
process
.
stdin
.
addStream
(
stdin
));
// Wait for stdout and stderr to be fully processed, because process.exitCode
// may complete first.
await
waitGroup
<
void
>(<
Future
<
void
>>[
...
...
packages/flutter_tools/lib/src/base/common.dart
View file @
36c5e321
...
...
@@ -39,3 +39,14 @@ class ToolExit implements Exception {
@override
String
toString
()
=>
'Exception:
$message
'
;
}
/// Indicates to the linter that the given future is intentionally not `await`-ed.
///
/// Has the same functionality as `unawaited` from `package:pedantic`.
///
/// In an async context, it is normally expected than all Futures are awaited,
/// and that is the basis of the lint unawaited_futures which is turned on for
/// the flutter_tools package. However, there are times where one or more
/// futures are intentionally not awaited. This function may be used to ignore a
/// particular future. It silences the unawaited_futures lint.
void
unawaited
(
Future
<
void
>
future
)
{
}
packages/flutter_tools/lib/src/base/process.dart
View file @
36c5e321
...
...
@@ -6,6 +6,7 @@ import 'dart:async';
import
'../convert.dart'
;
import
'../globals.dart'
;
import
'common.dart'
;
import
'file_system.dart'
;
import
'io.dart'
;
import
'process_manager.dart'
;
...
...
@@ -193,7 +194,7 @@ Future<int> runInteractively(List<String> command, {
);
// The real stdin will never finish streaming. Pipe until the child process
// finishes.
process
.
stdin
.
addStream
(
stdin
);
// ignore: unawaited_futures
unawaited
(
process
.
stdin
.
addStream
(
stdin
));
// Wait for stdout and stderr to be fully processed, because process.exitCode
// may complete first.
await
Future
.
wait
<
dynamic
>(<
Future
<
dynamic
>>[
...
...
packages/flutter_tools/lib/src/commands/analyze_once.dart
View file @
36c5e321
...
...
@@ -93,11 +93,11 @@ class AnalyzeOnce extends AnalyzeBase {
await
server
.
start
();
// Completing the future in the callback can't fail.
server
.
onExit
.
then
<
void
>((
int
exitCode
)
{
// ignore: unawaited_futures
unawaited
(
server
.
onExit
.
then
<
void
>((
int
exitCode
)
{
if
(!
analysisCompleter
.
isCompleted
)
{
analysisCompleter
.
completeError
(
'analysis server exited:
$exitCode
'
);
}
});
})
)
;
Cache
.
releaseLockEarly
();
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
36c5e321
...
...
@@ -421,23 +421,24 @@ class AppDomain extends Domain {
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
// We don't want to wait for this future to complete and callbacks won't fail.
// As it just writes to stdout.
connectionInfoCompleter
.
future
.
then
<
void
>((
DebugConnectionInfo
info
)
{
// ignore: unawaited_futures
final
Map
<
String
,
dynamic
>
params
=
<
String
,
dynamic
>{
'port'
:
info
.
httpUri
.
port
,
'wsUri'
:
info
.
wsUri
.
toString
(),
};
if
(
info
.
baseUri
!=
null
)
params
[
'baseUri'
]
=
info
.
baseUri
;
_sendAppEvent
(
app
,
'debugPort'
,
params
);
});
unawaited
(
connectionInfoCompleter
.
future
.
then
<
void
>(
(
DebugConnectionInfo
info
)
{
final
Map
<
String
,
dynamic
>
params
=
<
String
,
dynamic
>{
'port'
:
info
.
httpUri
.
port
,
'wsUri'
:
info
.
wsUri
.
toString
(),
};
if
(
info
.
baseUri
!=
null
)
params
[
'baseUri'
]
=
info
.
baseUri
;
_sendAppEvent
(
app
,
'debugPort'
,
params
);
},
));
}
final
Completer
<
void
>
appStartedCompleter
=
Completer
<
void
>();
// We don't want to wait for this future to complete, and callbacks won't fail,
// as it just writes to stdout.
appStartedCompleter
.
future
// ignore: unawaited_futures
.
then
<
void
>((
void
value
)
{
_sendAppEvent
(
app
,
'started'
);
});
unawaited
(
appStartedCompleter
.
future
.
then
<
void
>((
void
value
)
{
_sendAppEvent
(
app
,
'started'
);
}));
await
app
.
_runInZone
<
void
>(
this
,
()
async
{
try
{
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
36c5e321
...
...
@@ -398,9 +398,9 @@ class RunCommand extends RunCommandBase {
// Do not add more operations to the future.
final
Completer
<
void
>
appStartedTimeRecorder
=
Completer
<
void
>.
sync
();
// This callback can't throw.
appStartedTimeRecorder
.
future
.
then
<
void
>(
// ignore: unawaited_futures
unawaited
(
appStartedTimeRecorder
.
future
.
then
<
void
>(
(
_
)
{
appStartedTime
=
systemClock
.
now
();
}
);
)
)
;
final
int
result
=
await
runner
.
run
(
appStartedCompleter:
appStartedTimeRecorder
,
...
...
packages/flutter_tools/lib/src/dart/analysis.dart
View file @
36c5e321
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
hide
IOSink
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
...
...
@@ -42,7 +43,7 @@ class AnalysisServer {
printTrace
(
'dart
${command.skip(1).join(' ')}
'
);
_process
=
await
processManager
.
start
(
command
);
// This callback hookup can't throw.
_process
.
exitCode
.
whenComplete
(()
=>
_process
=
null
);
// ignore: unawaited_futures
unawaited
(
_process
.
exitCode
.
whenComplete
(()
=>
_process
=
null
));
final
Stream
<
String
>
errorStream
=
_process
.
stderr
.
transform
<
String
>(
utf8
.
decoder
).
transform
<
String
>(
const
LineSplitter
());
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
36c5e321
...
...
@@ -7,6 +7,7 @@ import 'package:json_rpc_2/json_rpc_2.dart' as rpc;
import
'package:meta/meta.dart'
;
import
'asset.dart'
;
import
'base/common.dart'
;
import
'base/context.dart'
;
import
'base/file_system.dart'
;
import
'base/io.dart'
;
...
...
@@ -336,7 +337,7 @@ class _DevFSHttpWriter {
if
(
retry
<
kMaxRetries
)
{
printTrace
(
'Retrying writing "
$deviceUri
" to DevFS due to error:
$e
'
);
// Synchronization is handled by the _completer below.
_scheduleWrite
(
deviceUri
,
content
,
retry
+
1
);
// ignore: unawaited_futures
unawaited
(
_scheduleWrite
(
deviceUri
,
content
,
retry
+
1
));
return
;
}
else
{
printError
(
'Error writing "
$deviceUri
" to DevFS:
$e
'
);
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
36c5e321
...
...
@@ -403,11 +403,11 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
'-L'
,
'
$hostPort
:
$_ipv4Loopback
:
$devicePort
'
,
device
.
id
,
'true'
];
final
Process
process
=
await
processManager
.
start
(
command
);
process
.
exitCode
.
then
((
int
exitCode
)
{
// ignore: unawaited_futures
unawaited
(
process
.
exitCode
.
then
((
int
exitCode
)
{
if
(
exitCode
!=
0
)
{
throwToolExit
(
'Failed to forward port:
$devicePort
'
);
}
});
})
)
;
_processes
[
hostPort
]
=
process
;
_forwardedPorts
.
add
(
ForwardedPort
(
hostPort
,
devicePort
));
return
hostPort
;
...
...
packages/flutter_tools/lib/src/ios/code_signing.dart
View file @
36c5e321
...
...
@@ -158,7 +158,7 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
final
String
opensslOutput
=
await
utf8
.
decodeStream
(
opensslProcess
.
stdout
);
// Fire and forget discard of the stderr stream so we don't hold onto resources.
// Don't care about the result.
opensslProcess
.
stderr
.
drain
<
String
>();
// ignore: unawaited_futures
unawaited
(
opensslProcess
.
stderr
.
drain
<
String
>());
if
(
await
opensslProcess
.
exitCode
!=
0
)
return
null
;
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
36c5e321
...
...
@@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({
}
// Trigger the start of the pipe -> stdout loop. Ignore exceptions.
listenToScriptOutputLine
();
// ignore: unawaited_futures
unawaited
(
listenToScriptOutputLine
());
buildCommands
.
add
(
'SCRIPT_OUTPUT_STREAM_FILE=
${scriptOutputPipeFile.absolute.path}
'
);
}
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
36c5e321
...
...
@@ -538,10 +538,10 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
// We don't want to wait for the process or its callback. Best effort
// cleanup in the callback.
_deviceProcess
.
exitCode
.
whenComplete
(()
{
// ignore: unawaited_futures
unawaited
(
_deviceProcess
.
exitCode
.
whenComplete
(()
{
if
(
_linesController
.
hasListener
)
_linesController
.
close
();
});
})
)
;
}
// Match the log prefix (in order to shorten it):
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
36c5e321
...
...
@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
import
'application_package.dart'
;
import
'artifacts.dart'
;
import
'asset.dart'
;
import
'base/common.dart'
;
import
'base/file_system.dart'
;
import
'base/io.dart'
;
import
'base/logger.dart'
;
...
...
@@ -739,10 +740,10 @@ abstract class ResidentRunner {
// This hooks up callbacks for when the connection stops in the future.
// We don't want to wait for them. We don't handle errors in those callbacks'
// futures either because they just print to logger and is not critical.
service
.
done
.
then
<
void
>(
// ignore: unawaited_futures
unawaited
(
service
.
done
.
then
<
void
>(
_serviceProtocolDone
,
onError:
_serviceProtocolError
).
whenComplete
(
_serviceDisconnected
);
).
whenComplete
(
_serviceDisconnected
)
)
;
}
}
}
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
36c5e321
...
...
@@ -502,13 +502,17 @@ class HotRunner extends ResidentRunner {
// Reload the isolate.
final
Completer
<
void
>
completer
=
Completer
<
void
>();
futures
.
add
(
completer
.
future
);
view
.
uiIsolate
.
reload
().
then
((
ServiceObject
_
)
{
// ignore: unawaited_futures
final
ServiceEvent
pauseEvent
=
view
.
uiIsolate
.
pauseEvent
;
if
((
pauseEvent
!=
null
)
&&
pauseEvent
.
isPauseEvent
)
{
// Resume the isolate so that it can be killed by the embedder.
return
view
.
uiIsolate
.
resume
();
}
}).
whenComplete
(()
{
completer
.
complete
(
null
);
});
unawaited
(
view
.
uiIsolate
.
reload
().
then
(
(
ServiceObject
_
)
{
final
ServiceEvent
pauseEvent
=
view
.
uiIsolate
.
pauseEvent
;
if
((
pauseEvent
!=
null
)
&&
pauseEvent
.
isPauseEvent
)
{
// Resume the isolate so that it can be killed by the embedder.
return
view
.
uiIsolate
.
resume
();
}
},
).
whenComplete
(
()
{
completer
.
complete
(
null
);
},
));
}
}
}
...
...
@@ -681,15 +685,19 @@ class HotRunner extends ResidentRunner {
final
List
<
Future
<
Map
<
String
,
dynamic
>>>
reportFutures
=
device
.
reloadSources
(
entryPath
,
pause:
pause
);
Future
.
wait
(
reportFutures
).
then
((
List
<
Map
<
String
,
dynamic
>>
reports
)
async
{
// ignore: unawaited_futures
// TODO(aam): Investigate why we are validating only first reload report,
// which seems to be current behavior
final
Map
<
String
,
dynamic
>
firstReport
=
reports
.
first
;
// Don't print errors because they will be printed further down when
// `validateReloadReport` is called again.
await
device
.
updateReloadStatus
(
validateReloadReport
(
firstReport
,
printErrors:
false
));
completer
.
complete
(
DeviceReloadReport
(
device
,
reports
));
});
unawaited
(
Future
.
wait
(
reportFutures
).
then
(
(
List
<
Map
<
String
,
dynamic
>>
reports
)
async
{
// TODO(aam): Investigate why we are validating only first reload report,
// which seems to be current behavior
final
Map
<
String
,
dynamic
>
firstReport
=
reports
.
first
;
// Don't print errors because they will be printed further down when
// `validateReloadReport` is called again.
await
device
.
updateReloadStatus
(
validateReloadReport
(
firstReport
,
printErrors:
false
),
);
completer
.
complete
(
DeviceReloadReport
(
device
,
reports
));
},
));
}
final
List
<
DeviceReloadReport
>
reports
=
await
Future
.
wait
(
allReportsFutures
);
for
(
DeviceReloadReport
report
in
reports
)
{
...
...
@@ -749,9 +757,9 @@ class HotRunner extends ResidentRunner {
futuresViews
.
add
(
view
.
uiIsolate
.
reload
());
}
final
Completer
<
void
>
deviceCompleter
=
Completer
<
void
>();
Future
.
wait
(
futuresViews
).
whenComplete
(()
{
// ignore: unawaited_futures
unawaited
(
Future
.
wait
(
futuresViews
).
whenComplete
(()
{
deviceCompleter
.
complete
(
device
.
refreshViews
());
});
})
)
;
allDevices
.
add
(
deviceCompleter
.
future
);
}
await
Future
.
wait
(
allDevices
);
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
36c5e321
...
...
@@ -495,9 +495,9 @@ class _FlutterPlatform extends PlatformPlugin {
bool
controllerSinkClosed
=
false
;
try
{
// Callback can't throw since it's just setting a variable.
controller
.
sink
.
done
.
whenComplete
(()
{
// ignore: unawaited_futures
unawaited
(
controller
.
sink
.
done
.
whenComplete
(()
{
controllerSinkClosed
=
true
;
});
})
)
;
// Prepare our WebSocket server to talk to the engine subproces.
final
HttpServer
server
=
await
HttpServer
.
bind
(
host
,
port
);
...
...
@@ -653,7 +653,7 @@ class _FlutterPlatform extends PlatformPlugin {
shellPath
);
controller
.
sink
.
addError
(
message
);
// Awaited for with 'sink.done' below.
controller
.
sink
.
close
();
// ignore: unawaited_futures
unawaited
(
controller
.
sink
.
close
());
printTrace
(
'test
$ourTestCount
: waiting for controller sink to close'
);
await
controller
.
sink
.
done
;
await
watcher
?.
handleTestCrashed
(
ProcessEvent
(
ourTestCount
,
process
));
...
...
@@ -666,7 +666,7 @@ class _FlutterPlatform extends PlatformPlugin {
final
String
message
=
_getErrorMessage
(
'Test never connected to test harness.'
,
testPath
,
shellPath
);
controller
.
sink
.
addError
(
message
);
// Awaited for with 'sink.done' below.
controller
.
sink
.
close
();
// ignore: unawaited_futures
unawaited
(
controller
.
sink
.
close
());
printTrace
(
'test
$ourTestCount
: waiting for controller sink to close'
);
await
controller
.
sink
.
done
;
await
watcher
...
...
@@ -748,7 +748,7 @@ class _FlutterPlatform extends PlatformPlugin {
shellPath
);
controller
.
sink
.
addError
(
message
);
// Awaited for with 'sink.done' below.
controller
.
sink
.
close
();
// ignore: unawaited_futures
unawaited
(
controller
.
sink
.
close
());
printTrace
(
'test
$ourTestCount
: waiting for controller sink to close'
);
await
controller
.
sink
.
done
;
break
;
...
...
@@ -792,7 +792,7 @@ class _FlutterPlatform extends PlatformPlugin {
}
if
(!
controllerSinkClosed
)
{
// Waiting below with await.
controller
.
sink
.
close
();
// ignore: unawaited_futures
unawaited
(
controller
.
sink
.
close
());
printTrace
(
'test
$ourTestCount
: waiting for controller sink to close'
);
await
controller
.
sink
.
done
;
}
...
...
packages/flutter_tools/lib/src/tester/flutter_tester.dart
View file @
36c5e321
...
...
@@ -152,7 +152,7 @@ class FlutterTesterDevice extends Device {
},
);
// Setting a bool can't fail in the callback.
_process
.
exitCode
.
then
<
void
>((
_
)
=>
_isRunning
=
false
);
// ignore: unawaited_futures
unawaited
(
_process
.
exitCode
.
then
<
void
>((
_
)
=>
_isRunning
=
false
));
_process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
packages/flutter_tools/test/compile_test.dart
View file @
36c5e321
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
...
...
@@ -445,23 +446,26 @@ example:org-dartlang-app:///lib/
]));
// The test manages timing via completers.
generator
.
recompile
(
// ignore: unawaited_futures
'/path/to/main.dart'
,
null
,
/* invalidatedFiles */
outputPath:
'/build/'
,
).
then
((
CompilerOutput
outputCompile
)
{
expect
(
logger
.
errorText
,
equals
(
'
\n
Compiler message:
\n
line1
\n
line2
\n
'
));
expect
(
outputCompile
.
outputFilename
,
equals
(
'/path/to/main.dart.dill'
));
compileExpressionResponseCompleter1
.
complete
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'result def
\n
line1
\n
line2
\n
def /path/to/main.dart.dill.incremental 0
\n
'
)));
});
unawaited
(
generator
.
recompile
(
'/path/to/main.dart'
,
null
,
/* invalidatedFiles */
outputPath:
'/build/'
,
).
then
((
CompilerOutput
outputCompile
)
{
expect
(
logger
.
errorText
,
equals
(
'
\n
Compiler message:
\n
line1
\n
line2
\n
'
));
expect
(
outputCompile
.
outputFilename
,
equals
(
'/path/to/main.dart.dill'
));
compileExpressionResponseCompleter1
.
complete
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'result def
\n
line1
\n
line2
\n
def /path/to/main.dart.dill.incremental 0
\n
'
)));
}),
);
// The test manages timing via completers.
final
Completer
<
bool
>
lastExpressionCompleted
=
Completer
<
bool
>();
generator
.
compileExpression
(
'0+1'
,
null
,
null
,
null
,
null
,
false
).
then
(
// ignore: unawaited_futures
unawaited
(
generator
.
compileExpression
(
'0+1'
,
null
,
null
,
null
,
null
,
false
).
then
(
(
CompilerOutput
outputExpression
)
{
expect
(
outputExpression
,
isNotNull
);
expect
(
outputExpression
.
outputFilename
,
...
...
@@ -470,17 +474,22 @@ example:org-dartlang-app:///lib/
compileExpressionResponseCompleter2
.
complete
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'result def
\n
line1
\n
line2
\n
def /path/to/main.dart.dill.incremental 0
\n
'
)));
});
},
),
);
// The test manages timing via completers.
generator
.
compileExpression
(
'1+1'
,
null
,
null
,
null
,
null
,
false
).
then
(
// ignore: unawaited_futures
unawaited
(
generator
.
compileExpression
(
'1+1'
,
null
,
null
,
null
,
null
,
false
).
then
(
(
CompilerOutput
outputExpression
)
{
expect
(
outputExpression
,
isNotNull
);
expect
(
outputExpression
.
outputFilename
,
equals
(
'/path/to/main.dart.dill.incremental'
));
expect
(
outputExpression
.
errorCount
,
0
);
lastExpressionCompleted
.
complete
(
true
);
});
},
)
);
compileResponseCompleter
.
complete
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'result abc
\n
line1
\n
line2
\n
abc /path/to/main.dart.dill 0
\n
'
...
...
packages/flutter_tools/test/integration/hot_reload_test.dart
View file @
36c5e321
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:vm_service_lib/vm_service_lib.dart'
;
...
...
@@ -76,10 +77,10 @@ void main() {
},
);
await
_flutter
.
resume
();
// we start paused so we can set up our TICK 1 listener before the app starts
sawTick1
.
future
.
timeout
(
// ignore: unawaited_futures
unawaited
(
sawTick1
.
future
.
timeout
(
const
Duration
(
seconds:
5
),
onTimeout:
()
{
print
(
'The test app is taking longer than expected to print its synchronization line...'
);
},
);
)
)
;
await
sawTick1
.
future
;
// after this, app is in steady state
await
_flutter
.
addBreakpoint
(
_project
.
scheduledBreakpointUri
,
...
...
packages/flutter_tools/test/integration/test_driver.dart
View file @
36c5e321
...
...
@@ -6,6 +6,7 @@ import 'dart:async';
import
'dart:convert'
;
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:meta/meta.dart'
;
...
...
@@ -104,10 +105,10 @@ abstract class FlutterTestDriver {
// This class doesn't use the result of the future. It's made available
// via a getter for external uses.
_process
.
exitCode
.
then
((
int
code
)
{
// ignore: unawaited_futures
unawaited
(
_process
.
exitCode
.
then
((
int
code
)
{
_debugPrint
(
'Process exited (
$code
)'
);
_hasExited
=
true
;
});
})
)
;
transformToLines
(
_process
.
stdout
).
listen
((
String
line
)
=>
_stdout
.
add
(
line
));
transformToLines
(
_process
.
stderr
).
listen
((
String
line
)
=>
_stderr
.
add
(
line
));
...
...
packages/flutter_tools/tool/daemon_client.dart
View file @
36c5e321
...
...
@@ -4,9 +4,10 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter_tools/src/base/common.dart'
;
Process
daemon
;
// To use, start from the console and enter:
...
...
@@ -82,10 +83,10 @@ Future<void> main() async {
});
// Print in the callback can't fail.
daemon
.
exitCode
.
then
<
void
>((
int
code
)
{
// ignore: unawaited_futures
unawaited
(
daemon
.
exitCode
.
then
<
void
>((
int
code
)
{
print
(
'daemon exiting (
$code
)'
);
exit
(
code
);
});
})
)
;
}
int
id
=
0
;
...
...
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