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
f62da010
Unverified
Commit
f62da010
authored
Aug 05, 2022
by
Jonah Williams
Committed by
GitHub
Aug 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure setAssetDirectory uses windows path (#109021)
parent
b02f68a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+1
-0
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+2
-1
vmservice_test.dart
...ages/flutter_tools/test/general.shard/vmservice_test.dart
+29
-0
No files found.
packages/flutter_tools/lib/src/run_hot.dart
View file @
f62da010
...
...
@@ -1047,6 +1047,7 @@ class HotRunner extends ResidentRunner {
assetsDirectory:
deviceAssetsDirectoryUri
,
uiIsolateId:
view
.
uiIsolate
!.
id
,
viewId:
view
.
id
,
windows:
device
.
targetPlatform
==
TargetPlatform
.
windows_x64
,
)
));
for
(
final
FlutterView
view
in
views
)
{
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
f62da010
...
...
@@ -478,12 +478,13 @@ class FlutterVmService {
required
Uri
assetsDirectory
,
required
String
?
viewId
,
required
String
?
uiIsolateId
,
required
bool
windows
,
})
async
{
await
callMethodWrapper
(
kSetAssetBundlePathMethod
,
isolateId:
uiIsolateId
,
args:
<
String
,
Object
?>{
'viewId'
:
viewId
,
'assetDirectory'
:
assetsDirectory
.
toFilePath
(
windows:
false
),
'assetDirectory'
:
assetsDirectory
.
toFilePath
(
windows:
windows
),
});
}
...
...
packages/flutter_tools/test/general.shard/vmservice_test.dart
View file @
f62da010
...
...
@@ -214,6 +214,7 @@ void main() {
assetsDirectory:
Uri
(
path:
'abc'
,
scheme:
'file'
),
viewId:
'abc'
,
uiIsolateId:
'def'
,
windows:
false
,
));
final
Map
<
String
,
Object
>
rawRequest
=
json
.
decode
(
await
completer
.
future
)
as
Map
<
String
,
Object
>;
...
...
@@ -228,6 +229,34 @@ void main() {
]));
});
testWithoutContext
(
'setAssetDirectory forwards arguments correctly - windows'
,
()
async
{
final
Completer
<
String
>
completer
=
Completer
<
String
>();
final
vm_service
.
VmService
vmService
=
vm_service
.
VmService
(
const
Stream
<
String
>.
empty
(),
completer
.
complete
,
);
final
FlutterVmService
flutterVmService
=
FlutterVmService
(
vmService
);
unawaited
(
flutterVmService
.
setAssetDirectory
(
assetsDirectory:
Uri
(
path:
'C:/Users/Tester/AppData/Local/Temp/hello_worldb42a6da5/hello_world/build/flutter_assets'
,
scheme:
'file'
),
viewId:
'abc'
,
uiIsolateId:
'def'
,
// If windows is not set to `true`, then the file path below is incorrectly prepended with a `/` which
// causes the engine asset manager to interpret the file scheme as invalid.
windows:
true
,
));
final
Map
<
String
,
Object
>
rawRequest
=
json
.
decode
(
await
completer
.
future
)
as
Map
<
String
,
Object
>;
expect
(
rawRequest
,
allOf
(<
Matcher
>[
containsPair
(
'method'
,
kSetAssetBundlePathMethod
),
containsPair
(
'params'
,
allOf
(<
Matcher
>[
containsPair
(
'viewId'
,
'abc'
),
containsPair
(
'assetDirectory'
,
r'C:\Users\Tester\AppData\Local\Temp\hello_worldb42a6da5\hello_world\build\flutter_assets'
),
containsPair
(
'isolateId'
,
'def'
),
])),
]));
});
testWithoutContext
(
'getSkSLs forwards arguments correctly'
,
()
async
{
final
Completer
<
String
>
completer
=
Completer
<
String
>();
final
vm_service
.
VmService
vmService
=
vm_service
.
VmService
(
...
...
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