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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 365463003: Implement scroll handler latency tracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 6 years, 5 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
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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 4509 matching lines...) Expand 10 before | Expand all | Expand 10 after
4520 set_needs_commit_count_(set_needs_commit_count), 4520 set_needs_commit_count_(set_needs_commit_count),
4521 set_needs_redraw_count_(set_needs_redraw_count) {} 4521 set_needs_redraw_count_(set_needs_redraw_count) {}
4522 4522
4523 virtual ~SimpleSwapPromiseMonitor() {} 4523 virtual ~SimpleSwapPromiseMonitor() {}
4524 4524
4525 virtual void OnSetNeedsCommitOnMain() OVERRIDE { 4525 virtual void OnSetNeedsCommitOnMain() OVERRIDE {
4526 (*set_needs_commit_count_)++; 4526 (*set_needs_commit_count_)++;
4527 } 4527 }
4528 4528
4529 virtual void OnSetNeedsRedrawOnImpl() OVERRIDE { 4529 virtual void OnSetNeedsRedrawOnImpl() OVERRIDE {
4530 (*set_needs_redraw_count_)++; 4530 (*set_needs_redraw_count_)++;
danakj 2014/07/08 16:49:08 Looks like we could do ADD_FAILURE() here too and
Sami 2014/07/09 13:28:55 Well spotted, done.
4531 } 4531 }
4532 4532
4533 virtual void OnForwardScrollUpdateToMainThreadOnImpl() OVERRIDE {
4534 ADD_FAILURE() << "Should not get called on main thread.";
4535 }
4536
4533 private: 4537 private:
4534 int* set_needs_commit_count_; 4538 int* set_needs_commit_count_;
4535 int* set_needs_redraw_count_; 4539 int* set_needs_redraw_count_;
4536 }; 4540 };
4537 4541
4538 class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest { 4542 class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest {
4539 public: 4543 public:
4540 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 4544 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
4541 4545
4542 virtual void WillBeginMainFrame() OVERRIDE { 4546 virtual void WillBeginMainFrame() OVERRIDE {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
4894 const gfx::Size bounds_; 4898 const gfx::Size bounds_;
4895 FakeContentLayerClient client_; 4899 FakeContentLayerClient client_;
4896 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; 4900 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_;
4897 scoped_refptr<FakePictureLayer> picture_layer_; 4901 scoped_refptr<FakePictureLayer> picture_layer_;
4898 Layer* child_layer_; 4902 Layer* child_layer_;
4899 }; 4903 };
4900 4904
4901 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); 4905 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
4902 4906
4903 } // namespace cc 4907 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698