From d20ce064a5f52b91ec613877c5cc7689e247c758 Mon Sep 17 00:00:00 2001 From: lingjhf Date: Tue, 6 Oct 2026 03:10:10 +0800 Subject: [PATCH] Make file identity and loopback fixtures portable to Windows --- test/adaptive_workspace_test.dart | 3 ++- test/agent_attachment_composer_test.dart | 3 ++- test/features/media/background_removal_controller_test.dart | 2 +- test/media_panel_test.dart | 2 +- test/workspace/external_media_import_test.dart | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/adaptive_workspace_test.dart b/test/adaptive_workspace_test.dart index 0994161..2ea6232 100644 --- a/test/adaptive_workspace_test.dart +++ b/test/adaptive_workspace_test.dart @@ -1054,7 +1054,8 @@ class _FixtureProjects extends Projects { id: 'media', name: 'Photo', storage: AssetStorage.external, - location: 'file:///test/photo.png', + location: const ExternalMediaFile(path: '/test/photo.png').sourceUri + .toString(), metadata: {'kind': 'image'}, ), ], diff --git a/test/agent_attachment_composer_test.dart b/test/agent_attachment_composer_test.dart index a9dfe6f..f9bf28b 100644 --- a/test/agent_attachment_composer_test.dart +++ b/test/agent_attachment_composer_test.dart @@ -47,7 +47,8 @@ class _AttachmentProjects extends Projects { id: 'asset-1', name: '片段.mov', storage: AssetStorage.external, - location: Uri.file('/tmp/片段.mov').toString(), + location: const ExternalMediaFile(path: '/tmp/片段.mov').sourceUri + .toString(), metadata: const {'kind': 'file'}, ), ], diff --git a/test/features/media/background_removal_controller_test.dart b/test/features/media/background_removal_controller_test.dart index aa5edb8..441a505 100644 --- a/test/features/media/background_removal_controller_test.dart +++ b/test/features/media/background_removal_controller_test.dart @@ -41,7 +41,7 @@ void main() { artifacts: [ ProcessingResourceArtifact( path: 'model.onnx', - url: Uri.parse('http://localhost:${server.port}/model'), + url: Uri.parse('http://127.0.0.1:${server.port}/model'), sha256: sha256.convert(payload).toString(), bytes: payload.length, ), diff --git a/test/media_panel_test.dart b/test/media_panel_test.dart index 2d39bea..5b6e49e 100644 --- a/test/media_panel_test.dart +++ b/test/media_panel_test.dart @@ -793,7 +793,7 @@ class _Projects extends Projects { id: file.localPath!, name: file.localPath!.split('/').last, storage: AssetStorage.external, - location: Uri.file(file.localPath!).toString(), + location: file.sourceUri.toString(), metadata: {'kind': mediaKindForPath(file.localPath!)}, ), ]; diff --git a/test/workspace/external_media_import_test.dart b/test/workspace/external_media_import_test.dart index 5670a8a..5606b62 100644 --- a/test/workspace/external_media_import_test.dart +++ b/test/workspace/external_media_import_test.dart @@ -19,7 +19,7 @@ AssetDocument _asset(String id, String path) => AssetDocument( id: id, name: id, storage: AssetStorage.external, - location: Uri.file(path).toString(), + location: ExternalMediaFile(path: path).sourceUri.toString(), ); class _Projects extends Projects {