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
b4c36717
Unverified
Commit
b4c36717
authored
Sep 06, 2019
by
Jonah Williams
Committed by
GitHub
Sep 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register reload sources call and make 'r' restart for web (#39950)
parent
8b90d9d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
+12
-17
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+2
-12
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+10
-5
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
b4c36717
...
...
@@ -43,11 +43,6 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
}
}
// TODO(jonahwilliams): remove this constant when the error message is removed.
// The web engine is currently spamming this message on certain pages. Filter it out
// until we remove it entirely. See flutter/flutter##37625.
const
String
_kBadError
=
'WARNING: 3D transformation matrix was passed to BitmapCanvas.'
;
/// A hot-runner which handles browser specific delegation.
class
ResidentWebRunner
extends
ResidentRunner
{
ResidentWebRunner
(
this
.
device
,
{
...
...
@@ -207,11 +202,9 @@ class ResidentWebRunner extends ResidentRunner {
if
(
supportsServiceProtocol
)
{
_stdOutSub
=
_debugConnection
.
vmService
.
onStdoutEvent
.
listen
((
vmservice
.
Event
log
)
{
final
String
message
=
utf8
.
decode
(
base64
.
decode
(
log
.
bytes
)).
trim
();
// TODO(jonahwilliams): remove this error once it is gone from the engine #37625.
if
(!
message
.
contains
(
_kBadError
))
{
printStatus
(
message
);
}
printStatus
(
message
);
});
unawaited
(
_debugConnection
.
vmService
.
registerService
(
'reloadSources'
,
'FlutterTools'
));
websocketUri
=
Uri
.
parse
(
_debugConnection
.
uri
);
}
if
(
websocketUri
!=
null
)
{
...
...
@@ -232,9 +225,6 @@ class ResidentWebRunner extends ResidentRunner {
String
reason
,
bool
benchmarkMode
=
false
,
})
async
{
if
(!
fullRestart
)
{
return
OperationResult
(
1
,
'hot reload not supported on the web.'
);
}
final
Stopwatch
timer
=
Stopwatch
()..
start
();
final
Status
status
=
logger
.
startProgress
(
'Performing hot restart...'
,
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
b4c36717
...
...
@@ -114,21 +114,27 @@ void main() {
));
final
DebugConnectionInfo
debugConnectionInfo
=
await
connectionInfoCompleter
.
future
;
verify
(
mockVmService
.
registerService
(
'reloadSources'
,
'FlutterTools'
)).
called
(
1
);
expect
(
bufferLogger
.
statusText
,
contains
(
'Debug service listening on ws://127.0.0.1/abcd/'
));
expect
(
debugConnectionInfo
.
wsUri
.
toString
(),
'ws://127.0.0.1/abcd/'
);
}));
test
(
'Can
not
hot reload after attaching'
,
()
=>
testbed
.
run
(()
async
{
_setupMocks
();
test
(
'Can hot reload after attaching'
,
()
=>
testbed
.
run
(()
async
{
_setupMocks
();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
));
await
connectionInfoCompleter
.
future
;
when
(
mockWebFs
.
recompile
()).
thenAnswer
((
Invocation
_
)
async
{
return
true
;
});
when
(
mockVmService
.
callServiceExtension
(
'hotRestart'
)).
thenAnswer
((
Invocation
_
)
async
{
return
Response
.
parse
(<
String
,
Object
>{
'type'
:
'Success'
});
});
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
false
);
expect
(
result
.
code
,
1
);
expect
(
result
.
message
,
contains
(
'hot reload not supported on the web.'
));
expect
(
result
.
code
,
0
);
}));
test
(
'Can hot restart after attaching'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -374,7 +380,6 @@ void main() {
}));
}
class
MockWebDevice
extends
Mock
implements
Device
{}
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