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

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

Issue 1124733003: Add test for begin frames when using SingleThreadProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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/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/location.h" 10 #include "base/location.h"
(...skipping 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 void CallOnDraw() { 2769 void CallOnDraw() {
2770 // Synchronous compositor does not draw unless told to do so by the output 2770 // Synchronous compositor does not draw unless told to do so by the output
2771 // surface. 2771 // surface.
2772 output_surface()->client()->OnDraw(); 2772 output_surface()->client()->OnDraw();
2773 } 2773 }
2774 }; 2774 };
2775 2775
2776 MULTI_THREAD_TEST_F( 2776 MULTI_THREAD_TEST_F(
2777 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor); 2777 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor);
2778 2778
2779 class LayerTreeHostTestBeginFrameNotificationSynchronousCompositor
2780 : public LayerTreeHostTest {
2781 protected:
2782 void BeginTest() override {
2783 saw_will_begin_impl_frame_ = false;
2784 PostCompositeImmediatelyToMainThread();
2785 }
2786
2787 void InitializeSettings(LayerTreeSettings* settings) override {
2788 settings->using_synchronous_renderer_compositor = true;
2789 settings->single_thread_proxy_scheduler = false;
2790 }
2791
2792 void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
2793 const BeginFrameArgs& args) override {
2794 EXPECT_EQ(base::TimeTicks(), args.deadline);
2795 EXPECT_EQ(BeginFrameArgs::DefaultInterval(), args.interval);
2796 saw_will_begin_impl_frame_ = true;
enne (OOO) 2015/05/04 22:30:27 I guess it was my understanding that it was also t
2797 }
2798
2799 void DidCommitAndDrawFrame() override { EndTest(); }
2800
2801 void AfterTest() override { EXPECT_TRUE(saw_will_begin_impl_frame_); }
2802
2803 private:
2804 bool saw_will_begin_impl_frame_;
2805 };
2806
2807 TEST_F(LayerTreeHostTestBeginFrameNotificationSynchronousCompositor,
2808 BeginFrameReceived) {
2809 RunTest(false, true, true);
2810 }
2811
2779 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync 2812 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync
2780 : public LayerTreeHostTestAbortedCommitDoesntStall { 2813 : public LayerTreeHostTestAbortedCommitDoesntStall {
2781 void InitializeSettings(LayerTreeSettings* settings) override { 2814 void InitializeSettings(LayerTreeSettings* settings) override {
2782 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); 2815 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
2783 settings->throttle_frame_production = false; 2816 settings->throttle_frame_production = false;
2784 } 2817 }
2785 }; 2818 };
2786 2819
2787 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync); 2820 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync);
2788 2821
(...skipping 4203 matching lines...) Expand 10 before | Expand all | Expand 10 after
6992 void AfterTest() override {} 7025 void AfterTest() override {}
6993 7026
6994 scoped_refptr<FakePictureLayer> content_child_layer_; 7027 scoped_refptr<FakePictureLayer> content_child_layer_;
6995 FakeContentLayerClient client_; 7028 FakeContentLayerClient client_;
6996 }; 7029 };
6997 7030
6998 SINGLE_AND_MULTI_THREAD_TEST_F( 7031 SINGLE_AND_MULTI_THREAD_TEST_F(
6999 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); 7032 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild);
7000 7033
7001 } // namespace cc 7034 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698