| Index: cc/trees/layer_tree_host_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
|
| index 73033a19b4866e75645d5cf21735c3bcd0ab92b8..d61fb2a281cb76da8964bd7b32309db817cea24e 100644
|
| --- a/cc/trees/layer_tree_host_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_unittest.cc
|
| @@ -701,7 +701,8 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
|
| class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
|
| : public LayerTreeHostTest {
|
| public:
|
| - LayerTreeHostTestFrameTimeUpdatesAfterActivationFails() : frame_(0) {}
|
| + LayerTreeHostTestFrameTimeUpdatesAfterActivationFails()
|
| + : frame_count_with_pending_tree_(0) {}
|
|
|
| virtual void BeginTest() OVERRIDE {
|
| layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
|
| @@ -710,9 +711,16 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
|
| PostSetNeedsCommitToMainThread();
|
| }
|
|
|
| + virtual void WillBeginFrameOnThread(LayerTreeHostImpl* host_impl,
|
| + const BeginFrameArgs& args) OVERRIDE {
|
| + if (host_impl->pending_tree())
|
| + frame_count_with_pending_tree_++;
|
| + }
|
| +
|
| virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
|
| - if (frame_ >= 1) {
|
| - EXPECT_NE(first_frame_time_, impl->CurrentFrameTimeTicks());
|
| + if (frame_count_with_pending_tree_ > 1) {
|
| + EXPECT_NE(first_frame_time_.ToInternalValue(),
|
| + impl->CurrentFrameTimeTicks().ToInternalValue());
|
| EndTest();
|
| return;
|
| }
|
| @@ -722,33 +730,18 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
|
| }
|
|
|
| virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE {
|
| - if (frame_ >= 1)
|
| - return true;
|
| -
|
| - return false;
|
| + return frame_count_with_pending_tree_ > 1;
|
| }
|
|
|
| - virtual bool CanActivatePendingTreeIfNeeded(LayerTreeHostImpl* impl)
|
| - OVERRIDE {
|
| - frame_++;
|
| - if (frame_ == 1) {
|
| - first_frame_time_ = impl->CurrentFrameTimeTicks();
|
| -
|
| - // Since base::TimeTicks::Now() uses a low-resolution clock on
|
| - // Windows, we need to make sure that the clock has incremented past
|
| - // first_frame_time_.
|
| - while (first_frame_time_ == base::TimeTicks::Now()) {}
|
| -
|
| - return false;
|
| - }
|
| -
|
| - return true;
|
| + virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
|
| + if (impl->settings().impl_side_painting)
|
| + EXPECT_NE(frame_count_with_pending_tree_, 1);
|
| }
|
|
|
| virtual void AfterTest() OVERRIDE {}
|
|
|
| private:
|
| - int frame_;
|
| + int frame_count_with_pending_tree_;
|
| base::TimeTicks first_frame_time_;
|
| };
|
|
|
|
|