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
95889463
Unverified
Commit
95889463
authored
Oct 05, 2018
by
Jason Simmons
Committed by
GitHub
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not continue a hot restart if _restartFromSources fails (#22645)
parent
a6c5ec2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-1
hot_test.dart
packages/flutter_tools/test/hot_test.dart
+7
-3
No files found.
packages/flutter_tools/lib/src/run_hot.dart
View file @
95889463
...
@@ -502,7 +502,9 @@ class HotRunner extends ResidentRunner {
...
@@ -502,7 +502,9 @@ class HotRunner extends ResidentRunner {
try
{
try
{
if
(!(
await
hotRunnerConfig
.
setupHotRestart
()))
if
(!(
await
hotRunnerConfig
.
setupHotRestart
()))
return
OperationResult
(
1
,
'setupHotRestart failed'
);
return
OperationResult
(
1
,
'setupHotRestart failed'
);
await
_restartFromSources
();
final
OperationResult
result
=
await
_restartFromSources
();
if
(!
result
.
isOk
)
return
result
;
}
finally
{
}
finally
{
status
.
cancel
();
status
.
cancel
();
}
}
...
...
packages/flutter_tools/test/hot_test.dart
View file @
95889463
...
@@ -103,14 +103,16 @@ void main() {
...
@@ -103,14 +103,16 @@ void main() {
testUsingContext
(
'no setup'
,
()
async
{
testUsingContext
(
'no setup'
,
()
async
{
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
expect
((
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
)).
isOk
,
tru
e
);
expect
((
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
)).
isOk
,
fals
e
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
Artifacts:
()
=>
mockArtifacts
,
});
});
testUsingContext
(
'setup function succeeds'
,
()
async
{
testUsingContext
(
'setup function succeeds'
,
()
async
{
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
expect
((
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
)).
isOk
,
true
);
final
OperationResult
result
=
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
);
expect
(
result
.
isOk
,
false
);
expect
(
result
.
message
,
isNot
(
'setupHotRestart failed'
));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
...
@@ -118,7 +120,9 @@ void main() {
...
@@ -118,7 +120,9 @@ void main() {
testUsingContext
(
'setup function fails'
,
()
async
{
testUsingContext
(
'setup function fails'
,
()
async
{
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
MockDevice
(),
generator:
residentCompiler
,
trackWidgetCreation:
false
)];
expect
((
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
)).
isOk
,
false
);
final
OperationResult
result
=
await
HotRunner
(
devices
).
restart
(
fullRestart:
true
);
expect
(
result
.
isOk
,
false
);
expect
(
result
.
message
,
'setupHotRestart failed'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
false
),
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
false
),
...
...
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