re-enable skipandsubmitframe (#22546)

This commit is contained in:
Chris Yang 2020-11-17 09:53:01 -08:00 committed by GitHub
parent 1a5ec52a6c
commit 2c2e3a2885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1001,7 +1001,13 @@ TEST_F(ShellTest,
// TODO(https://github.com/flutter/flutter/issues/59816): Enable on fuchsia.
// TODO(https://github.com/flutter/flutter/issues/66056): Deflake on all other
// platforms
TEST_F(ShellTest, DISABLED_SkipAndSubmitFrame) {
TEST_F(ShellTest,
#if defined(OS_FUCHSIA)
DISABLED_SkipAndSubmitFrame
#else
SkipAndSubmitFrame
#endif
) {
auto settings = CreateSettingsForFixture();
fml::AutoResetWaitableEvent end_frame_latch;
std::shared_ptr<ShellTestExternalViewEmbedder> external_view_embedder;
@ -1009,8 +1015,11 @@ TEST_F(ShellTest, DISABLED_SkipAndSubmitFrame) {
auto end_frame_callback =
[&](bool should_resubmit_frame,
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {
external_view_embedder->UpdatePostPrerollResult(
PostPrerollResult::kSuccess);
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>(
@ -1033,10 +1042,12 @@ TEST_F(ShellTest, DISABLED_SkipAndSubmitFrame) {
end_frame_latch.Wait();
ASSERT_EQ(0, external_view_embedder->GetSubmittedFrameCount());
PumpOneFrame(shell.get());
// Let the resubmitted frame to run and `GetSubmittedFrameCount` should be
// called.
end_frame_latch.Wait();
ASSERT_EQ(1, external_view_embedder->GetSubmittedFrameCount());
PlatformViewNotifyDestroyed(shell.get());
DestroyShell(std::move(shell));
}