| 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/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation.h" | 7 #include "cc/animation/animation.h" |
| 8 #include "cc/animation/animation_registrar.h" | 8 #include "cc/animation/animation_registrar.h" |
| 9 #include "cc/animation/layer_animation_controller.h" | 9 #include "cc/animation/layer_animation_controller.h" |
| 10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 ended_(false), | 313 ended_(false), |
| 314 impl_thread_(NULL), | 314 impl_thread_(NULL), |
| 315 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 315 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 316 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); | 316 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 LayerTreeTest::~LayerTreeTest() {} | 319 LayerTreeTest::~LayerTreeTest() {} |
| 320 | 320 |
| 321 void LayerTreeTest::EndTest() { | 321 void LayerTreeTest::EndTest() { |
| 322 // For the case where we EndTest during BeginTest(), set a flag to indicate | 322 // For the case where we EndTest during BeginTest(), set a flag to indicate |
| 323 // that the test should end the second beginTest regains control. | 323 // that the test should end the second BeginTest regains control. |
| 324 if (beginning_) { | 324 if (beginning_) { |
| 325 end_when_begin_returns_ = true; | 325 end_when_begin_returns_ = true; |
| 326 } else if (proxy()) { | 326 } else if (proxy()) { |
| 327 // Racy timeouts and explicit EndTest calls might have cleaned up | 327 // Racy timeouts and explicit EndTest calls might have cleaned up |
| 328 // the tree host. Should check proxy first. | 328 // the tree host. Should check proxy first. |
| 329 proxy()->MainThread()->PostTask( | 329 proxy()->MainThread()->PostTask( |
| 330 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 330 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 | 333 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 ASSERT_FALSE(layer_tree_host_.get()); | 540 ASSERT_FALSE(layer_tree_host_.get()); |
| 541 client_.reset(); | 541 client_.reset(); |
| 542 if (timed_out_) { | 542 if (timed_out_) { |
| 543 FAIL() << "Test timed out"; | 543 FAIL() << "Test timed out"; |
| 544 return; | 544 return; |
| 545 } | 545 } |
| 546 AfterTest(); | 546 AfterTest(); |
| 547 } | 547 } |
| 548 | 548 |
| 549 } // namespace cc | 549 } // namespace cc |
| OLD | NEW |