@@ -158,30 +158,20 @@ TEST_F(ShellTest, AnimatorDoesNotNotifyIdleBeforeRender) {
158158 latch.Wait ();
159159 ASSERT_FALSE (delegate.notify_idle_called_ );
160160
161- fml::AutoResetWaitableEvent render_latch;
162161 // Validate it has not notified idle and try to render.
163162 task_runners.GetUITaskRunner ()->PostDelayedTask (
164163 [&] {
165164 ASSERT_FALSE (delegate.notify_idle_called_ );
166- EXPECT_CALL (delegate, OnAnimatorBeginFrame).WillOnce ([&] {
167- auto layer_tree = std::make_unique<LayerTree>(
168- LayerTree::Config (), SkISize::Make (600 , 800 ));
169- animator->Render (std::move (layer_tree), 1.0 );
170- render_latch.Signal ();
171- });
172- // Request a frame that builds a layer tree and renders a frame.
173- // When the frame is rendered, render_latch will be signaled.
174- animator->RequestFrame (true );
165+ auto layer_tree = std::make_unique<LayerTree>(LayerTree::Config (),
166+ SkISize::Make (600 , 800 ));
167+ animator->Render (std::move (layer_tree), 1.0 );
175168 task_runners.GetPlatformTaskRunner ()->PostTask (flush_vsync_task);
176169 },
177170 // See kNotifyIdleTaskWaitTime in animator.cc.
178171 fml::TimeDelta::FromMilliseconds (60 ));
179172 latch.Wait ();
180- render_latch.Wait ();
181173
182- // A frame has been rendered, and the next frame request will notify idle.
183- // But at the moment there isn't another frame request, therefore it still
184- // hasn't notified idle.
174+ // Still hasn't notified idle because there has been no frame request.
185175 task_runners.GetUITaskRunner ()->PostTask ([&] {
186176 ASSERT_FALSE (delegate.notify_idle_called_ );
187177 // False to avoid getting cals to BeginFrame that will request more frames
@@ -249,16 +239,16 @@ TEST_F(ShellTest, AnimatorDoesNotNotifyDelegateIfPipelineIsNotEmpty) {
249239
250240 for (int i = 0 ; i < 2 ; i++) {
251241 task_runners.GetUITaskRunner ()->PostTask ([&] {
252- EXPECT_CALL (delegate, OnAnimatorBeginFrame).WillOnce ([&] {
253- auto layer_tree = std::make_unique<LayerTree>(LayerTree::Config (),
254- SkISize::Make (600 , 800 ));
255- animator->Render (std::move (layer_tree), 1.0 );
256- begin_frame_latch.Signal ();
257- });
258242 animator->RequestFrame ();
259243 task_runners.GetPlatformTaskRunner ()->PostTask (flush_vsync_task);
260244 });
261245 begin_frame_latch.Wait ();
246+
247+ PostTaskSync (task_runners.GetUITaskRunner (), [&] {
248+ auto layer_tree = std::make_unique<LayerTree>(LayerTree::Config (),
249+ SkISize::Make (600 , 800 ));
250+ animator->Render (std::move (layer_tree), 1.0 );
251+ });
262252 }
263253
264254 PostTaskSync (task_runners.GetUITaskRunner (), [&] { animator.reset (); });
0 commit comments