Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 14474006: Add a command line flag for dumping trace events to VLOG (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Now beautiful" Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/test/cc_test_suite.cc ('K') | « cc/test/cc_test_suite.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "cc/animation/timing_function.h" 11 #include "cc/animation/timing_function.h"
12 #include "cc/base/switches.h"
12 #include "cc/base/thread_impl.h" 13 #include "cc/base/thread_impl.h"
13 #include "cc/input/input_handler.h" 14 #include "cc/input/input_handler.h"
14 #include "cc/layers/content_layer.h" 15 #include "cc/layers/content_layer.h"
15 #include "cc/layers/layer.h" 16 #include "cc/layers/layer.h"
16 #include "cc/layers/layer_impl.h" 17 #include "cc/layers/layer_impl.h"
17 #include "cc/test/animation_test_common.h" 18 #include "cc/test/animation_test_common.h"
18 #include "cc/test/fake_layer_tree_host_client.h" 19 #include "cc/test/fake_layer_tree_host_client.h"
19 #include "cc/test/fake_output_surface.h" 20 #include "cc/test/fake_output_surface.h"
20 #include "cc/test/occlusion_tracker_test_common.h" 21 #include "cc/test/occlusion_tracker_test_common.h"
21 #include "cc/test/tiled_layer_test_common.h" 22 #include "cc/test/tiled_layer_test_common.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 started_(false), 307 started_(false),
307 ended_(false), 308 ended_(false),
308 timeout_seconds_(0), 309 timeout_seconds_(0),
309 impl_thread_(NULL), 310 impl_thread_(NULL),
310 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 311 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
311 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); 312 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr();
312 313
313 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was 314 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was
314 // specified (for running in a debugger). 315 // specified (for running in a debugger).
315 CommandLine* command_line = CommandLine::ForCurrentProcess(); 316 CommandLine* command_line = CommandLine::ForCurrentProcess();
316 if (!command_line->HasSwitch("cc-layer-tree-test-no-timeout")) 317 if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout))
317 timeout_seconds_ = 5; 318 timeout_seconds_ = 5;
318 } 319 }
319 320
320 LayerTreeTest::~LayerTreeTest() {} 321 LayerTreeTest::~LayerTreeTest() {}
321 322
322 void LayerTreeTest::EndTest() { 323 void LayerTreeTest::EndTest() {
323 // For the case where we EndTest during BeginTest(), set a flag to indicate 324 // For the case where we EndTest during BeginTest(), set a flag to indicate
324 // that the test should end the second BeginTest regains control. 325 // that the test should end the second BeginTest regains control.
325 if (beginning_) { 326 if (beginning_) {
326 end_when_begin_returns_ = true; 327 end_when_begin_returns_ = true;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 537 }
537 538
538 schedule_when_set_visible_true_ = false; 539 schedule_when_set_visible_true_ = false;
539 base::TimeTicks now = base::TimeTicks::Now(); 540 base::TimeTicks now = base::TimeTicks::Now();
540 layer_tree_host_->UpdateAnimations(now); 541 layer_tree_host_->UpdateAnimations(now);
541 layer_tree_host_->Composite(now); 542 layer_tree_host_->Composite(now);
542 } 543 }
543 544
544 void LayerTreeTest::RunTest(bool threaded) { 545 void LayerTreeTest::RunTest(bool threaded) {
545 if (threaded) { 546 if (threaded) {
546 impl_thread_.reset(new base::Thread("LayerTreeTest")); 547 impl_thread_.reset(new base::Thread("Compositor"));
547 ASSERT_TRUE(impl_thread_->Start()); 548 ASSERT_TRUE(impl_thread_->Start());
548 } 549 }
549 550
550 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread(); 551 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread();
551 552
552 // Spend less time waiting for vsync because the output is mocked out. 553 // Spend less time waiting for vsync because the output is mocked out.
553 settings_.refresh_rate = 200.0; 554 settings_.refresh_rate = 200.0;
554 InitializeSettings(&settings_); 555 InitializeSettings(&settings_);
555 556
556 main_ccthread_->PostTask( 557 main_ccthread_->PostTask(
(...skipping 16 matching lines...) Expand all
573 ASSERT_FALSE(layer_tree_host_.get()); 574 ASSERT_FALSE(layer_tree_host_.get());
574 client_.reset(); 575 client_.reset();
575 if (timed_out_) { 576 if (timed_out_) {
576 FAIL() << "Test timed out"; 577 FAIL() << "Test timed out";
577 return; 578 return;
578 } 579 }
579 AfterTest(); 580 AfterTest();
580 } 581 }
581 582
582 } // namespace cc 583 } // namespace cc
OLDNEW
« cc/test/cc_test_suite.cc ('K') | « cc/test/cc_test_suite.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698