| 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 4726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4737 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( | 4737 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( |
| 4738 new SimpleSwapPromiseMonitor(layer_tree_host(), | 4738 new SimpleSwapPromiseMonitor(layer_tree_host(), |
| 4739 NULL, | 4739 NULL, |
| 4740 &set_needs_commit_count, | 4740 &set_needs_commit_count, |
| 4741 &set_needs_redraw_count)); | 4741 &set_needs_redraw_count)); |
| 4742 layer_tree_host()->SetNeedsUpdateLayers(); | 4742 layer_tree_host()->SetNeedsUpdateLayers(); |
| 4743 EXPECT_EQ(2, set_needs_commit_count); | 4743 EXPECT_EQ(2, set_needs_commit_count); |
| 4744 EXPECT_EQ(0, set_needs_redraw_count); | 4744 EXPECT_EQ(0, set_needs_redraw_count); |
| 4745 } | 4745 } |
| 4746 | 4746 |
| 4747 { | |
| 4748 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( | |
| 4749 new SimpleSwapPromiseMonitor(layer_tree_host(), | |
| 4750 NULL, | |
| 4751 &set_needs_commit_count, | |
| 4752 &set_needs_redraw_count)); | |
| 4753 layer_tree_host()->SetNeedsAnimate(); | |
| 4754 EXPECT_EQ(3, set_needs_commit_count); | |
| 4755 EXPECT_EQ(0, set_needs_redraw_count); | |
| 4756 } | |
| 4757 | |
| 4758 EndTest(); | 4747 EndTest(); |
| 4759 } | 4748 } |
| 4760 | 4749 |
| 4761 virtual void AfterTest() OVERRIDE {} | 4750 virtual void AfterTest() OVERRIDE {} |
| 4762 }; | 4751 }; |
| 4763 | 4752 |
| 4764 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); | 4753 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); |
| 4765 | 4754 |
| 4766 } // namespace cc | 4755 } // namespace cc |
| OLD | NEW |