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 5223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5234 public: | 5234 public: |
5235 explicit TestSwapPromise(TestSwapPromiseResult* result) | 5235 explicit TestSwapPromise(TestSwapPromiseResult* result) |
5236 : result_(result) { | 5236 : result_(result) { |
5237 } | 5237 } |
5238 | 5238 |
5239 virtual ~TestSwapPromise() { | 5239 virtual ~TestSwapPromise() { |
5240 base::AutoLock lock(result_->lock); | 5240 base::AutoLock lock(result_->lock); |
5241 result_->dtor_called = true; | 5241 result_->dtor_called = true; |
5242 } | 5242 } |
5243 | 5243 |
5244 virtual void DidSwap(CompositorFrameMetadata* metadata) OVERRIDE { | 5244 virtual void DidSwap() OVERRIDE { |
5245 base::AutoLock lock(result_->lock); | 5245 base::AutoLock lock(result_->lock); |
5246 EXPECT_FALSE(result_->did_swap_called); | 5246 EXPECT_FALSE(result_->did_swap_called); |
5247 EXPECT_FALSE(result_->did_not_swap_called); | 5247 EXPECT_FALSE(result_->did_not_swap_called); |
5248 result_->did_swap_called = true; | 5248 result_->did_swap_called = true; |
5249 } | 5249 } |
5250 | 5250 |
5251 virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE { | 5251 virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE { |
5252 base::AutoLock lock(result_->lock); | 5252 base::AutoLock lock(result_->lock); |
5253 EXPECT_FALSE(result_->did_swap_called); | 5253 EXPECT_FALSE(result_->did_swap_called); |
5254 EXPECT_FALSE(result_->did_not_swap_called); | 5254 EXPECT_FALSE(result_->did_not_swap_called); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5330 } | 5330 } |
5331 | 5331 |
5332 int commit_count_; | 5332 int commit_count_; |
5333 int commit_complete_count_; | 5333 int commit_complete_count_; |
5334 TestSwapPromiseResult swap_promise_result_[3]; | 5334 TestSwapPromiseResult swap_promise_result_[3]; |
5335 }; | 5335 }; |
5336 | 5336 |
5337 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); | 5337 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); |
5338 | 5338 |
5339 } // namespace cc | 5339 } // namespace cc |
OLD | NEW |