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

Side by Side Diff: cc/layer_tree_host_unittest_animation.cc

Issue 11571068: Use WeakPtr for posting cc tasks to main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use WeakPtr for tasks posted to main thread in ThreadedTests Created 8 years 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "cc/animation_curve.h" 7 #include "cc/animation_curve.h"
8 #include "cc/layer.h" 8 #include "cc/layer.h"
9 #include "cc/layer_animation_controller.h" 9 #include "cc/layer_animation_controller.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // handling the case where setNeedsAnimate() is called inside the begin frame 78 // handling the case where setNeedsAnimate() is called inside the begin frame
79 // flow. 79 // flow.
80 class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback : 80 class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback :
81 public LayerTreeHostAnimationTest { 81 public LayerTreeHostAnimationTest {
82 public: 82 public:
83 LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback() 83 LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback()
84 : num_animates_(0) { 84 : num_animates_(0) {
85 } 85 }
86 86
87 virtual void beginTest() OVERRIDE { 87 virtual void beginTest() OVERRIDE {
88 postSetNeedsAnimateToMainThread(); 88 postSetNeedsCommitToMainThread();
89 } 89 }
90 90
91 virtual void animate(base::TimeTicks) OVERRIDE { 91 virtual void animate(base::TimeTicks) OVERRIDE {
92 if (!num_animates_) { 92 if (!num_animates_) {
93 m_layerTreeHost->setNeedsAnimate(); 93 m_layerTreeHost->setNeedsAnimate();
94 num_animates_++; 94 num_animates_++;
95 return; 95 return;
96 } 96 }
97 endTest(); 97 endTest();
98 } 98 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 private: 391 private:
392 FakeContentLayerClient client_; 392 FakeContentLayerClient client_;
393 scoped_refptr<FakeContentLayer> update_check_layer_; 393 scoped_refptr<FakeContentLayer> update_check_layer_;
394 }; 394 };
395 395
396 MULTI_THREAD_TEST_F( 396 MULTI_THREAD_TEST_F(
397 LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity) 397 LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity)
398 398
399 } // namespace 399 } // namespace
400 } // namespace cc 400 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698