From 858d6612e64cc81ee1bd04406909220c9f745fb9 Mon Sep 17 00:00:00 2001 From: Yegor Date: Mon, 4 Oct 2021 16:44:36 -0700 Subject: [PATCH] [web] remove platform initialization timeout (flutter/engine#29011) --- .../flutter/lib/web_ui/lib/src/ui/test_embedding.dart | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/test_embedding.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/test_embedding.dart index d8a6c2f8cf..3e70d91954 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/test_embedding.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/test_embedding.dart @@ -19,7 +19,6 @@ Future ensureTestPlatformInitializedThenRunTest(dynamic Function() body return _testPlatformInitializedFuture!.then((_) => body()); } -// TODO(yjbanov): can we make this late non-null? See https://github.com/dart-lang/sdk/issues/42214 Future? _platformInitializedFuture; Future webOnlyInitializeTestDomRenderer({double devicePixelRatio = 3.0}) { @@ -35,14 +34,10 @@ Future webOnlyInitializeTestDomRenderer({double devicePixelRatio = 3.0}) { engine.scheduleFrameCallback = () {}; debugEmulateFlutterTesterEnvironment = true; + // Initialize platform once and reuse across all tests. if (_platformInitializedFuture != null) { return _platformInitializedFuture!; } - - // Only load the Ahem font once and await the same future in all tests. return _platformInitializedFuture = - webOnlyInitializePlatform(assetManager: engine.WebOnlyMockAssetManager()) - .timeout(const Duration(seconds: 2), onTimeout: () async { - throw Exception('Timed out loading Ahem font.'); - }); + webOnlyInitializePlatform(assetManager: engine.WebOnlyMockAssetManager()); }