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

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: rebase Created 7 years, 7 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
« no previous file with comments | « 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_(this) { 311 weak_factory_(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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 539 }
539 540
540 schedule_when_set_visible_true_ = false; 541 schedule_when_set_visible_true_ = false;
541 base::TimeTicks now = base::TimeTicks::Now(); 542 base::TimeTicks now = base::TimeTicks::Now();
542 layer_tree_host_->UpdateAnimations(now); 543 layer_tree_host_->UpdateAnimations(now);
543 layer_tree_host_->Composite(now); 544 layer_tree_host_->Composite(now);
544 } 545 }
545 546
546 void LayerTreeTest::RunTest(bool threaded) { 547 void LayerTreeTest::RunTest(bool threaded) {
547 if (threaded) { 548 if (threaded) {
548 impl_thread_.reset(new base::Thread("LayerTreeTest")); 549 impl_thread_.reset(new base::Thread("Compositor"));
549 ASSERT_TRUE(impl_thread_->Start()); 550 ASSERT_TRUE(impl_thread_->Start());
550 } 551 }
551 552
552 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread(); 553 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread();
553 554
554 // Spend less time waiting for vsync because the output is mocked out. 555 // Spend less time waiting for vsync because the output is mocked out.
555 settings_.refresh_rate = 200.0; 556 settings_.refresh_rate = 200.0;
556 InitializeSettings(&settings_); 557 InitializeSettings(&settings_);
557 558
558 main_ccthread_->PostTask( 559 main_ccthread_->PostTask(
(...skipping 16 matching lines...) Expand all
575 ASSERT_FALSE(layer_tree_host_.get()); 576 ASSERT_FALSE(layer_tree_host_.get());
576 client_.reset(); 577 client_.reset();
577 if (timed_out_) { 578 if (timed_out_) {
578 FAIL() << "Test timed out"; 579 FAIL() << "Test timed out";
579 return; 580 return;
580 } 581 }
581 AfterTest(); 582 AfterTest();
582 } 583 }
583 584
584 } // namespace cc 585 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/cc_test_suite.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698