Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5596f0e

Browse files
committed
Remove persistent cache unittest timeout
This fixes flutter/flutter#42465
1 parent b320dab commit 5596f0e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

shell/common/persistent_cache_unittests.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ TEST_F(ShellTest, CacheSkSLWorks) {
3636
auto settings = CreateSettingsForFixture();
3737
settings.cache_sksl = true;
3838
settings.dump_skp_on_shader_compilation = true;
39+
40+
fml::AutoResetWaitableEvent firstFrameLatch;
41+
settings.frame_rasterized_callback =
42+
[&firstFrameLatch](const FrameTiming& t) { firstFrameLatch.Signal(); };
43+
3944
auto sksl_config = RunConfiguration::InferFromSettings(settings);
4045
sksl_config.SetEntrypoint("emptyMain");
4146
std::unique_ptr<Shell> shell = CreateShell(settings);
@@ -55,9 +60,7 @@ TEST_F(ShellTest, CacheSkSLWorks) {
5560
root->Add(physical_shape_layer);
5661
};
5762
PumpOneFrame(shell.get(), 100, 100, builder);
58-
fml::Status result =
59-
shell->WaitForFirstFrame(fml::TimeDelta::FromMilliseconds(1000));
60-
ASSERT_TRUE(result.ok());
63+
firstFrameLatch.Wait();
6164
WaitForIO(shell.get());
6265

6366
// Some skp should be dumped due to shader compilations.
@@ -88,9 +91,9 @@ TEST_F(ShellTest, CacheSkSLWorks) {
8891
shell = CreateShell(settings);
8992
PlatformViewNotifyCreated(shell.get());
9093
RunEngine(shell.get(), std::move(normal_config));
94+
firstFrameLatch.Reset();
9195
PumpOneFrame(shell.get(), 100, 100, builder);
92-
result = shell->WaitForFirstFrame(fml::TimeDelta::FromMilliseconds(1000));
93-
ASSERT_TRUE(result.ok());
96+
firstFrameLatch.Wait();
9497
WaitForIO(shell.get());
9598

9699
// To check that all shaders are precompiled, verify that no new skp is dumped

0 commit comments

Comments
 (0)