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
8eee93fa
Unverified
Commit
8eee93fa
authored
Sep 11, 2019
by
Jonah Williams
Committed by
GitHub
Sep 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we send hot restart events for flutter web (#40175)
parent
c5e2bf5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+8
-0
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+14
-0
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
8eee93fa
...
...
@@ -19,6 +19,7 @@ import '../convert.dart';
import
'../device.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
import
'../reporting/reporting.dart'
;
import
'../resident_runner.dart'
;
import
'../web/web_device.dart'
;
import
'../web/web_runner.dart'
;
...
...
@@ -258,6 +259,13 @@ class ResidentWebRunner extends ResidentRunner {
return
OperationResult
(
1
,
'Page requires refresh.'
);
}
finally
{
status
.
stop
();
HotEvent
(
'restart'
,
targetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
web_javascript
),
sdkName:
await
device
.
sdkNameAndVersion
,
emulator:
false
,
fullRestart:
true
,
reason:
reason
,
).
send
();
}
}
status
.
stop
();
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
8eee93fa
...
...
@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/build_runner/resident_web_runner.dart'
;
import
'package:flutter_tools/src/build_runner/web_fs.dart'
;
...
...
@@ -149,6 +150,12 @@ void main() {
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
false
);
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
}));
test
(
'Can hot restart after attaching'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -167,6 +174,12 @@ void main() {
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
true
);
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
}));
test
(
'Fails on compilation errors in hot restart'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -394,6 +407,7 @@ void main() {
}));
}
class
MockFlutterUsage
extends
Mock
implements
Usage
{}
class
MockWebDevice
extends
Mock
implements
ChromeDevice
{}
class
MockBuildDaemonCreator
extends
Mock
implements
BuildDaemonCreator
{}
class
MockFlutterWebFs
extends
Mock
implements
WebFs
{}
...
...
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