mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix URL construction in the test entry point generated by the web bootstrap script (#88201)
This commit is contained in:
parent
e761e64983
commit
ddb8bfb72b
@ -193,7 +193,7 @@ String generateTestEntrypoint({
|
|||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
ui.debugEmulateFlutterTesterEnvironment = true;
|
ui.debugEmulateFlutterTesterEnvironment = true;
|
||||||
await ui.webOnlyInitializePlatform();
|
await ui.webOnlyInitializePlatform();
|
||||||
webGoldenComparator = DefaultWebGoldenComparator(Uri.parse('$absolutePath'));
|
webGoldenComparator = DefaultWebGoldenComparator(Uri.parse('${Uri.file(absolutePath)}'));
|
||||||
(ui.window as dynamic).debugOverrideDevicePixelRatio(3.0);
|
(ui.window as dynamic).debugOverrideDevicePixelRatio(3.0);
|
||||||
(ui.window as dynamic).webOnlyDebugPhysicalSizeOverride = const ui.Size(2400, 1800);
|
(ui.window as dynamic).webOnlyDebugPhysicalSizeOverride = const ui.Size(2400, 1800);
|
||||||
|
|
||||||
|
@ -102,4 +102,15 @@ test('generateBootstrapScript includes loading indicator', () {
|
|||||||
|
|
||||||
expect(result, contains('test_config.testExecutable'));
|
expect(result, contains('test_config.testExecutable'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('generateTestEntrypoint embeds urls correctly', () {
|
||||||
|
final String result = generateTestEntrypoint(
|
||||||
|
relativeTestPath: 'relative_path.dart',
|
||||||
|
absolutePath: '/test/absolute_path.dart',
|
||||||
|
testConfigPath: null,
|
||||||
|
languageVersion: LanguageVersion(2, 8),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(result, contains("Uri.parse('file:///test/absolute_path.dart')"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user