Unverified Commit e4b7e87b authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Pass uri instead of filepaths when hot-reloading. (#21201)

* Pass uri instead of filepaths when hot-reloading.

Bug: https://github.com/flutter/flutter/issues/21168

* Remove imports. Enable another test

* Restore skipping of test on mac
parent 7598050f
......@@ -1149,13 +1149,11 @@ class Isolate extends ServiceObjectOwner {
final Map<String, dynamic> arguments = <String, dynamic>{
'pause': pause
};
// TODO(goderbauer): Transfer Uri (instead of file path) when remote end supports it.
// Note: Despite the name, `rootLibUri` and `packagesUri` expect file paths.
if (rootLibUri != null) {
arguments['rootLibUri'] = rootLibUri.toFilePath(windows: false);
arguments['rootLibUri'] = rootLibUri.toString();
}
if (packagesUri != null) {
arguments['packagesUri'] = packagesUri.toFilePath(windows: false);
arguments['packagesUri'] = packagesUri.toString();
}
final Map<String, dynamic> response = await invokeRpcRaw('_reloadSources', params: arguments);
return response;
......
......@@ -4,7 +4,6 @@
import 'package:file/file.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/platform.dart';
import '../src/common.dart';
import '../src/context.dart';
......@@ -38,7 +37,5 @@ void main() {
await _flutterAttach.attach(_flutterRun.vmServicePort);
await _flutterAttach.hotReload();
});
// TODO(dantup): Unskip after flutter-tester is fixed on Windows:
// https://github.com/flutter/flutter/issues/17833.
}, timeout: const Timeout.factor(6), skip: platform.isWindows);
}, timeout: const Timeout.factor(6));
}
......@@ -32,9 +32,7 @@ void main() {
test('works without error', () async {
await _flutter.run();
await _flutter.hotReload();
// TODO(dantup): Unskip after flutter-tester is fixed on Windows:
// https://github.com/flutter/flutter/issues/17833.
}, skip: platform.isWindows);
});
test('hits breakpoints with file:// prefixes after reload', () async {
await _flutter.run(withDebugger: true);
......@@ -44,12 +42,10 @@ void main() {
new Uri.file(_project.breakpointFile).toString(),
_project.breakpointLine);
expect(isolate.pauseEvent, isInstanceOf<VMPauseBreakpointEvent>());
// TODO(dantup): Unskip for Mac when [1] is fixed, unskip on Windows when
// both [1] and [2] are fixed.
// TODO(dantup): Unskip for Mac when [1] is fixed.
// [1] hot reload/breakpoints fail when uris prefixed with file://
// https://github.com/flutter/flutter/issues/18441
// [2] flutter-tester doesn't work on Windows
// https://github.com/flutter/flutter/issues/17833
}, skip: !platform.isLinux);
}, skip: !platform.isLinux && !platform.isWindows);
}, timeout: const Timeout.factor(6));
}
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