| 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 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5225 | 5225 |
| 5226 bool did_swap_called; | 5226 bool did_swap_called; |
| 5227 bool did_not_swap_called; | 5227 bool did_not_swap_called; |
| 5228 bool dtor_called; | 5228 bool dtor_called; |
| 5229 SwapPromise::DidNotSwapReason reason; | 5229 SwapPromise::DidNotSwapReason reason; |
| 5230 }; | 5230 }; |
| 5231 | 5231 |
| 5232 class TestSwapPromise : public SwapPromise { | 5232 class TestSwapPromise : public SwapPromise { |
| 5233 public: | 5233 public: |
| 5234 explicit TestSwapPromise(TestSwapPromiseResult* result) | 5234 explicit TestSwapPromise(TestSwapPromiseResult* result) |
| 5235 : result_(result) { | 5235 : SwapPromise(SWAP_PROMISE_UNKNOWN), |
| 5236 result_(result) { |
| 5236 } | 5237 } |
| 5237 | 5238 |
| 5238 virtual ~TestSwapPromise() { | 5239 virtual ~TestSwapPromise() { |
| 5239 result_->dtor_called = true; | 5240 result_->dtor_called = true; |
| 5240 } | 5241 } |
| 5241 | 5242 |
| 5242 virtual void DidSwap() OVERRIDE { | 5243 virtual void DidSwap() OVERRIDE { |
| 5243 EXPECT_FALSE(result_->did_swap_called); | 5244 EXPECT_FALSE(result_->did_swap_called); |
| 5244 EXPECT_FALSE(result_->did_not_swap_called); | 5245 EXPECT_FALSE(result_->did_not_swap_called); |
| 5245 result_->did_swap_called = true; | 5246 result_->did_swap_called = true; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5317 } | 5318 } |
| 5318 | 5319 |
| 5319 int commit_count_; | 5320 int commit_count_; |
| 5320 int commit_complete_count_; | 5321 int commit_complete_count_; |
| 5321 TestSwapPromiseResult swap_promise_result_[3]; | 5322 TestSwapPromiseResult swap_promise_result_[3]; |
| 5322 }; | 5323 }; |
| 5323 | 5324 |
| 5324 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); | 5325 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); |
| 5325 | 5326 |
| 5326 } // namespace cc | 5327 } // namespace cc |
| OLD | NEW |