| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
| 9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
| 10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 LayerTreeTest::LayerTreeTest() | 442 LayerTreeTest::LayerTreeTest() |
| 443 : output_surface_(nullptr), | 443 : output_surface_(nullptr), |
| 444 external_begin_frame_source_(nullptr), | 444 external_begin_frame_source_(nullptr), |
| 445 beginning_(false), | 445 beginning_(false), |
| 446 end_when_begin_returns_(false), | 446 end_when_begin_returns_(false), |
| 447 timed_out_(false), | 447 timed_out_(false), |
| 448 scheduled_(false), | 448 scheduled_(false), |
| 449 started_(false), | 449 started_(false), |
| 450 ended_(false), | 450 ended_(false), |
| 451 delegating_renderer_(false), | 451 delegating_renderer_(false), |
| 452 verify_property_trees_(true), |
| 452 timeout_seconds_(0), | 453 timeout_seconds_(0), |
| 453 weak_factory_(this) { | 454 weak_factory_(this) { |
| 454 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); | 455 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); |
| 455 | 456 |
| 456 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was | 457 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was |
| 457 // specified (for running in a debugger). | 458 // specified (for running in a debugger). |
| 458 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 459 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 459 if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout)) | 460 if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout)) |
| 460 timeout_seconds_ = 5; | 461 timeout_seconds_ = 5; |
| 461 } | 462 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 703 |
| 703 main_task_runner_ = base::MessageLoopProxy::current(); | 704 main_task_runner_ = base::MessageLoopProxy::current(); |
| 704 | 705 |
| 705 delegating_renderer_ = delegating_renderer; | 706 delegating_renderer_ = delegating_renderer; |
| 706 | 707 |
| 707 // Spend less time waiting for BeginFrame because the output is | 708 // Spend less time waiting for BeginFrame because the output is |
| 708 // mocked out. | 709 // mocked out. |
| 709 settings_.renderer_settings.refresh_rate = 200.0; | 710 settings_.renderer_settings.refresh_rate = 200.0; |
| 710 settings_.background_animation_rate = 200.0; | 711 settings_.background_animation_rate = 200.0; |
| 711 settings_.impl_side_painting = impl_side_painting; | 712 settings_.impl_side_painting = impl_side_painting; |
| 712 settings_.verify_property_trees = true; | 713 settings_.verify_property_trees = verify_property_trees_; |
| 713 InitializeSettings(&settings_); | 714 InitializeSettings(&settings_); |
| 714 | 715 |
| 715 main_task_runner_->PostTask( | 716 main_task_runner_->PostTask( |
| 716 FROM_HERE, | 717 FROM_HERE, |
| 717 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); | 718 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); |
| 718 | 719 |
| 719 if (timeout_seconds_) { | 720 if (timeout_seconds_) { |
| 720 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); | 721 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); |
| 721 main_task_runner_->PostDelayedTask( | 722 main_task_runner_->PostDelayedTask( |
| 722 FROM_HERE, | 723 FROM_HERE, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return -1; | 783 return -1; |
| 783 } | 784 } |
| 784 | 785 |
| 785 void LayerTreeTest::DestroyLayerTreeHost() { | 786 void LayerTreeTest::DestroyLayerTreeHost() { |
| 786 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 787 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 787 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 788 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 788 layer_tree_host_ = nullptr; | 789 layer_tree_host_ = nullptr; |
| 789 } | 790 } |
| 790 | 791 |
| 791 } // namespace cc | 792 } // namespace cc |
| OLD | NEW |