Visitar URL original
Properly parse URIs for testPath when the host is running on Windows.… · ahmedsameha1/flutter@e676092 · GitHub
Skip to content

Commit e676092

Browse files
Eyasbkonyi
authored andcommitted
Properly parse URIs for testPath when the host is running on Windows. (flutter#176881)
When futter integration tests run in Windows with TestGoldenComparator and the new Host<->VM comparator, our URI parsing for `testPath` only works on UNIX-like systems, and causes Windows paths to complain later down the line. This change replaces `Uri.parse(testPath)` with `Uri.file(testPath, windows: Platform.isWindows)` so that `TestGoldenComparator` can know how to handle it properly. Fixes flutter#171126. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [*] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. - I'm having trouble figuring out how to test the fix on Windows. Making sure existing tests continue to work is one thing, but I'm not sure ow to introduce a new Windows-only test case that starts an Android VM, because that's the only way this bug is triggered. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Ben Konyi <bkonyi@google.com>
1 parent 55342f8 commit e676092

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/flutter_tools/lib/src/test/flutter_platform.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class FlutterPlatform extends PlatformPlugin {
525525
static const _kExtension = 'ext.$_kEventName';
526526

527527
Future<void> _listenToVmServiceForGoldens({required Uri uri, required String testPath}) async {
528-
final Uri goldensBaseUri = Uri.parse(testPath);
528+
final goldensBaseUri = Uri.file(testPath, windows: globals.platform.isWindows);
529529
final FlutterVmService vmService = await connectToVmService(uri, logger: logger);
530530
final IsolateRef testAppIsolate = await vmService.findExtensionIsolate(_kExtension);
531531
await vmService.service.streamListen(_kEventName);

0 commit comments

Comments
 (0)