From c03dac9a74b312a6b4f6757c5720a9713c8935db Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 16 Oct 2023 13:58:19 -0700 Subject: [PATCH] Avoid use of Platform.script in isolates_test.dart (#136669) Avoid using string replacement on a bogus string to get the relative directory of this test. https://github.com/flutter/engine/pull/46911 will fix the behavior of Platform.script so it actually has the file being executed, but that will not be the file the test author wrote, it will be `listener.dart.dill` generated by tool code and running in a temp directory for this particular test. We may want to come up with a more robust way of providing the test for framework test users, but we should do so in a way that will not limit the ability to run multiple tests in a single process if that offers performance benefits. --- packages/flutter/test/foundation/isolates_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/flutter/test/foundation/isolates_test.dart b/packages/flutter/test/foundation/isolates_test.dart index 24b834bc0c..eead4e2e2d 100644 --- a/packages/flutter/test/foundation/isolates_test.dart +++ b/packages/flutter/test/foundation/isolates_test.dart @@ -89,9 +89,8 @@ Future expectFileSuccessfullyCompletes(String filename) async { final String flutterRoot = platform.environment['FLUTTER_ROOT']!; final String dartPath = fs.path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart'); - final String packageRoot = fs.path.dirname(fs.path.fromUri(platform.script)); final String scriptPath = - fs.path.join(packageRoot, 'test', 'foundation', filename); + fs.path.join(flutterRoot, 'packages', 'flutter', 'test', 'foundation', filename); // Enable asserts to also catch potentially invalid assertions. final ProcessResult result = await Process.run(