OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 4673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4684 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( | 4684 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( |
4685 new SimpleSwapPromiseMonitor(layer_tree_host(), | 4685 new SimpleSwapPromiseMonitor(layer_tree_host(), |
4686 NULL, | 4686 NULL, |
4687 &set_needs_commit_count, | 4687 &set_needs_commit_count, |
4688 &set_needs_redraw_count)); | 4688 &set_needs_redraw_count)); |
4689 layer_tree_host()->SetNeedsUpdateLayers(); | 4689 layer_tree_host()->SetNeedsUpdateLayers(); |
4690 EXPECT_EQ(2, set_needs_commit_count); | 4690 EXPECT_EQ(2, set_needs_commit_count); |
4691 EXPECT_EQ(0, set_needs_redraw_count); | 4691 EXPECT_EQ(0, set_needs_redraw_count); |
4692 } | 4692 } |
4693 | 4693 |
| 4694 { |
| 4695 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( |
| 4696 new SimpleSwapPromiseMonitor(layer_tree_host(), |
| 4697 NULL, |
| 4698 &set_needs_commit_count, |
| 4699 &set_needs_redraw_count)); |
| 4700 layer_tree_host()->SetNeedsAnimate(); |
| 4701 EXPECT_EQ(3, set_needs_commit_count); |
| 4702 EXPECT_EQ(0, set_needs_redraw_count); |
| 4703 } |
| 4704 |
4694 EndTest(); | 4705 EndTest(); |
4695 } | 4706 } |
4696 | 4707 |
4697 virtual void AfterTest() OVERRIDE {} | 4708 virtual void AfterTest() OVERRIDE {} |
4698 }; | 4709 }; |
4699 | 4710 |
4700 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); | 4711 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); |
4701 | 4712 |
4702 } // namespace cc | 4713 } // namespace cc |
OLD | NEW |