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

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

Issue 737943002: Update from https://crrev.com/304715 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/test/layer_tree_pixel_test.cc ('k') | cc/test/pixel_test.cc » ('j') | 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"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 scheduled_(false), 483 scheduled_(false),
484 started_(false), 484 started_(false),
485 ended_(false), 485 ended_(false),
486 delegating_renderer_(false), 486 delegating_renderer_(false),
487 timeout_seconds_(0), 487 timeout_seconds_(0),
488 weak_factory_(this) { 488 weak_factory_(this) {
489 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); 489 main_thread_weak_ptr_ = weak_factory_.GetWeakPtr();
490 490
491 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was 491 // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was
492 // specified (for running in a debugger). 492 // specified (for running in a debugger).
493 CommandLine* command_line = CommandLine::ForCurrentProcess(); 493 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
494 if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout)) 494 if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout))
495 timeout_seconds_ = 5; 495 timeout_seconds_ = 5;
496 } 496 }
497 497
498 LayerTreeTest::~LayerTreeTest() {} 498 LayerTreeTest::~LayerTreeTest() {}
499 499
500 void LayerTreeTest::EndTest() { 500 void LayerTreeTest::EndTest() {
501 if (ended_) 501 if (ended_)
502 return; 502 return;
503 ended_ = true; 503 ended_ = true;
(...skipping 13 matching lines...) Expand all
517 main_task_runner_->PostDelayedTask( 517 main_task_runner_->PostDelayedTask(
518 FROM_HERE, 518 FROM_HERE,
519 base::Bind(&LayerTreeTest::EndTest, main_thread_weak_ptr_), 519 base::Bind(&LayerTreeTest::EndTest, main_thread_weak_ptr_),
520 base::TimeDelta::FromMilliseconds(delay_milliseconds)); 520 base::TimeDelta::FromMilliseconds(delay_milliseconds));
521 } 521 }
522 522
523 void LayerTreeTest::PostAddAnimationToMainThread( 523 void LayerTreeTest::PostAddAnimationToMainThread(
524 Layer* layer_to_receive_animation) { 524 Layer* layer_to_receive_animation) {
525 main_task_runner_->PostTask( 525 main_task_runner_->PostTask(
526 FROM_HERE, 526 FROM_HERE,
527 base::Bind(&LayerTreeTest::DispatchAddAnimation, 527 base::Bind(&LayerTreeTest::DispatchAddAnimation, main_thread_weak_ptr_,
528 main_thread_weak_ptr_, 528 base::Unretained(layer_to_receive_animation), 0.000004));
529 base::Unretained(layer_to_receive_animation),
530 0.000001));
531 } 529 }
532 530
533 void LayerTreeTest::PostAddInstantAnimationToMainThread( 531 void LayerTreeTest::PostAddInstantAnimationToMainThread(
534 Layer* layer_to_receive_animation) { 532 Layer* layer_to_receive_animation) {
535 main_task_runner_->PostTask( 533 main_task_runner_->PostTask(
536 FROM_HERE, 534 FROM_HERE,
537 base::Bind(&LayerTreeTest::DispatchAddAnimation, 535 base::Bind(&LayerTreeTest::DispatchAddAnimation,
538 main_thread_weak_ptr_, 536 main_thread_weak_ptr_,
539 base::Unretained(layer_to_receive_animation), 537 base::Unretained(layer_to_receive_animation),
540 0.0)); 538 0.0));
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 return -1; 820 return -1;
823 } 821 }
824 822
825 void LayerTreeTest::DestroyLayerTreeHost() { 823 void LayerTreeTest::DestroyLayerTreeHost() {
826 if (layer_tree_host_ && layer_tree_host_->root_layer()) 824 if (layer_tree_host_ && layer_tree_host_->root_layer())
827 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 825 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
828 layer_tree_host_ = nullptr; 826 layer_tree_host_ = nullptr;
829 } 827 }
830 828
831 } // namespace cc 829 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_pixel_test.cc ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698