Unverified Commit fe310148 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tool] Remove extra usage of .packages in vm service API (#52845)

parent bec7f84a
......@@ -288,13 +288,11 @@ class FlutterDevice {
bool pause = false,
}) {
final Uri deviceEntryUri = devFS.baseUri.resolveUri(globals.fs.path.toUri(entryPath));
final Uri devicePackagesUri = devFS.baseUri.resolve('.packages');
return <Future<Map<String, dynamic>>>[
for (final Isolate isolate in vmService.vm.isolates)
isolate.reloadSources(
pause: pause,
rootLibUri: deviceEntryUri,
packagesUri: devicePackagesUri,
),
];
}
......
......@@ -460,7 +460,7 @@ class HotRunner extends ResidentRunner {
) {
return Future.wait(<Future<void>>[
for (final FlutterView view in device.views)
view.runFromSource(entryUri, packagesUri, assetsDirectoryUri),
view.runFromSource(entryUri, assetsDirectoryUri),
]);
}
......
......@@ -1040,14 +1040,12 @@ class VM extends ServiceObjectOwner {
Future<ServiceMap> runInView(
String viewId,
Uri main,
Uri packages,
Uri assetsDirectory,
) {
return invokeRpc<ServiceMap>('_flutter.runInView',
params: <String, dynamic>{
'viewId': viewId,
'mainScript': main.toString(),
'packagesFile': packages.toString(),
'assetDirectory': assetsDirectory.toString(),
});
}
......@@ -1256,7 +1254,6 @@ class Isolate extends ServiceObjectOwner {
Future<Map<String, dynamic>> reloadSources({
bool pause = false,
Uri rootLibUri,
Uri packagesUri,
}) async {
try {
final Map<String, dynamic> arguments = <String, dynamic>{
......@@ -1265,9 +1262,6 @@ class Isolate extends ServiceObjectOwner {
if (rootLibUri != null) {
arguments['rootLibUri'] = rootLibUri.toString();
}
if (packagesUri != null) {
arguments['packagesUri'] = packagesUri.toString();
}
final Map<String, dynamic> response = await invokeRpcRaw('_reloadSources', params: arguments);
return response;
} on rpc.RpcException catch (e) {
......@@ -1492,7 +1486,6 @@ class FlutterView extends ServiceObject {
// TODO(johnmccutchan): Report errors when running failed.
Future<void> runFromSource(
Uri entryUri,
Uri packagesUri,
Uri assetsDirectoryUri,
) async {
final String viewId = id;
......@@ -1511,7 +1504,6 @@ class FlutterView extends ServiceObject {
});
await owner.vm.runInView(viewId,
entryUri,
packagesUri,
assetsDirectoryUri);
await completer.future;
await owner.vm.refreshViews(waitForViews: true);
......
......@@ -96,7 +96,7 @@ void main() {
final MockVM mockVM = MockVM();
when(mockVMService.vm).thenReturn(mockVM);
when(mockVM.isolates).thenReturn(<Isolate>[mockIsolate]);
when(mockFlutterView.runFromSource(any, any, any)).thenAnswer((Invocation invocation) async {});
when(mockFlutterView.runFromSource(any, any)).thenAnswer((Invocation invocation) async {});
when(mockFlutterDevice.stopEchoingDeviceLog()).thenAnswer((Invocation invocation) async { });
when(mockFlutterDevice.observatoryUris).thenAnswer((_) => Stream<Uri>.value(testUri));
when(mockFlutterDevice.connect(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment