Delete ShellTest::ResubmitFrame (flutter/engine#32972)
This commit is contained in:
@@ -1285,63 +1285,6 @@ TEST_F(ShellTest,
|
||||
DestroyShell(std::move(shell));
|
||||
}
|
||||
|
||||
// TODO(https://github.com/flutter/flutter/issues/100273): Disabled due to
|
||||
// flakiness.
|
||||
// TODO(https://github.com/flutter/flutter/issues/59816): Enable on fuchsia.
|
||||
TEST_F(ShellTest,
|
||||
#if defined(OS_FUCHSIA)
|
||||
DISABLED_ResubmitFrame
|
||||
#else
|
||||
DISABLED_ResubmitFrame
|
||||
#endif
|
||||
) {
|
||||
auto settings = CreateSettingsForFixture();
|
||||
fml::AutoResetWaitableEvent end_frame_latch;
|
||||
std::shared_ptr<ShellTestExternalViewEmbedder> external_view_embedder;
|
||||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger_ref;
|
||||
auto end_frame_callback =
|
||||
[&](bool should_resubmit_frame,
|
||||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {
|
||||
if (!raster_thread_merger_ref) {
|
||||
raster_thread_merger_ref = raster_thread_merger;
|
||||
}
|
||||
if (should_resubmit_frame && !raster_thread_merger->IsMerged()) {
|
||||
raster_thread_merger->MergeWithLease(10);
|
||||
external_view_embedder->UpdatePostPrerollResult(
|
||||
PostPrerollResult::kSuccess);
|
||||
}
|
||||
end_frame_latch.Signal();
|
||||
};
|
||||
external_view_embedder = std::make_shared<ShellTestExternalViewEmbedder>(
|
||||
end_frame_callback, PostPrerollResult::kResubmitFrame, true);
|
||||
|
||||
auto shell = CreateShell(std::move(settings), GetTaskRunnersForFixture(),
|
||||
false, external_view_embedder);
|
||||
PlatformViewNotifyCreated(shell.get());
|
||||
|
||||
auto configuration = RunConfiguration::InferFromSettings(settings);
|
||||
configuration.SetEntrypoint("emptyMain");
|
||||
RunEngine(shell.get(), std::move(configuration));
|
||||
|
||||
ASSERT_EQ(0, external_view_embedder->GetSubmittedFrameCount());
|
||||
|
||||
PumpOneFrame(shell.get());
|
||||
// `EndFrame` changed the post preroll result to `kSuccess` and merged the
|
||||
// threads. During the frame, the threads are not merged, So no
|
||||
// `external_view_embedder->GetSubmittedFrameCount()` is called.
|
||||
end_frame_latch.Wait();
|
||||
ASSERT_TRUE(raster_thread_merger_ref->IsMerged());
|
||||
|
||||
// This is the resubmitted frame, which threads are also merged.
|
||||
end_frame_latch.Wait();
|
||||
// 2 frames are submitted because `kResubmitFrame`, but only the 2nd frame
|
||||
// should be submitted with `external_view_embedder`, hence the below check.
|
||||
ASSERT_EQ(1, external_view_embedder->GetSubmittedFrameCount());
|
||||
|
||||
PlatformViewNotifyDestroyed(shell.get());
|
||||
DestroyShell(std::move(shell));
|
||||
}
|
||||
|
||||
TEST(SettingsTest, FrameTimingSetsAndGetsProperly) {
|
||||
// Ensure that all phases are in kPhases.
|
||||
ASSERT_EQ(sizeof(FrameTiming::kPhases),
|
||||
|
||||
Reference in New Issue
Block a user