OLD | NEW |
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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
9 #include "cc/layers/delegated_frame_provider.h" | 9 #include "cc/layers/delegated_frame_provider.h" |
10 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 lose_after_evict_ = false; | 930 lose_after_evict_ = false; |
931 RunTest(true, true, false); | 931 RunTest(true, true, false); |
932 } | 932 } |
933 | 933 |
934 TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures, | 934 TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures, |
935 LoseBeforeEvict_MultiThread_DelegatingRenderer_ImplSidePaint) { | 935 LoseBeforeEvict_MultiThread_DelegatingRenderer_ImplSidePaint) { |
936 lose_after_evict_ = false; | 936 lose_after_evict_ = false; |
937 RunTest(true, true, true); | 937 RunTest(true, true, true); |
938 } | 938 } |
939 | 939 |
940 class DISABLED_LayerTreeHostContextTestLostContextWhileUpdatingResources | 940 class LayerTreeHostContextTestLostContextWhileUpdatingResources |
941 : public LayerTreeHostContextTest { | 941 : public LayerTreeHostContextTest { |
942 public: | 942 public: |
943 DISABLED_LayerTreeHostContextTestLostContextWhileUpdatingResources() | 943 LayerTreeHostContextTestLostContextWhileUpdatingResources() |
944 : parent_(FakeContentLayer::Create(&client_)), | 944 : parent_(FakeContentLayer::Create(&client_)), |
945 num_children_(50), | 945 num_children_(50), |
946 times_to_lose_on_end_query_(3) {} | 946 times_to_lose_on_end_query_(3) {} |
947 | 947 |
948 virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() OVERRIDE { | 948 virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() OVERRIDE { |
949 scoped_ptr<TestWebGraphicsContext3D> context = | 949 scoped_ptr<TestWebGraphicsContext3D> context = |
950 LayerTreeHostContextTest::CreateContext3d(); | 950 LayerTreeHostContextTest::CreateContext3d(); |
951 if (times_to_lose_on_end_query_) { | 951 if (times_to_lose_on_end_query_) { |
952 --times_to_lose_on_end_query_; | 952 --times_to_lose_on_end_query_; |
953 context->set_times_end_query_succeeds(5); | 953 context->set_times_end_query_succeeds(5); |
(...skipping 13 matching lines...) Expand all Loading... |
967 } | 967 } |
968 | 968 |
969 layer_tree_host()->SetRootLayer(parent_); | 969 layer_tree_host()->SetRootLayer(parent_); |
970 LayerTreeHostContextTest::SetupTree(); | 970 LayerTreeHostContextTest::SetupTree(); |
971 } | 971 } |
972 | 972 |
973 virtual void BeginTest() OVERRIDE { | 973 virtual void BeginTest() OVERRIDE { |
974 PostSetNeedsCommitToMainThread(); | 974 PostSetNeedsCommitToMainThread(); |
975 } | 975 } |
976 | 976 |
977 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 977 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
978 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 978 EXPECT_EQ(0, times_to_lose_on_end_query_); |
979 EndTest(); | 979 EndTest(); |
980 } | 980 } |
981 | 981 |
982 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { | 982 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { |
983 EXPECT_TRUE(succeeded); | 983 EXPECT_TRUE(succeeded); |
984 } | 984 } |
985 | 985 |
986 virtual void AfterTest() OVERRIDE { | 986 virtual void AfterTest() OVERRIDE { |
987 EXPECT_EQ(0, times_to_lose_on_end_query_); | 987 EXPECT_EQ(0, times_to_lose_on_end_query_); |
988 } | 988 } |
989 | 989 |
990 private: | 990 private: |
991 FakeContentLayerClient client_; | 991 FakeContentLayerClient client_; |
992 scoped_refptr<FakeContentLayer> parent_; | 992 scoped_refptr<FakeContentLayer> parent_; |
993 int num_children_; | 993 int num_children_; |
994 int times_to_lose_on_end_query_; | 994 int times_to_lose_on_end_query_; |
995 }; | 995 }; |
996 | 996 |
997 // Disabled (crbug.com/313790) | |
998 SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F( | 997 SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F( |
999 DISABLED_LayerTreeHostContextTestLostContextWhileUpdatingResources); | 998 LayerTreeHostContextTestLostContextWhileUpdatingResources); |
1000 | 999 |
1001 class LayerTreeHostContextTestLayersNotified | 1000 class LayerTreeHostContextTestLayersNotified |
1002 : public LayerTreeHostContextTest { | 1001 : public LayerTreeHostContextTest { |
1003 public: | 1002 public: |
1004 LayerTreeHostContextTestLayersNotified() | 1003 LayerTreeHostContextTestLayersNotified() |
1005 : LayerTreeHostContextTest(), | 1004 : LayerTreeHostContextTest(), |
1006 num_commits_(0) {} | 1005 num_commits_(0) {} |
1007 | 1006 |
1008 virtual void SetupTree() OVERRIDE { | 1007 virtual void SetupTree() OVERRIDE { |
1009 root_ = FakeContentLayer::Create(&client_); | 1008 root_ = FakeContentLayer::Create(&client_); |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 protected: | 2289 protected: |
2291 FakeContentLayerClient client_; | 2290 FakeContentLayerClient client_; |
2292 scoped_refptr<FakeContentLayer> layer_; | 2291 scoped_refptr<FakeContentLayer> layer_; |
2293 int num_commits_; | 2292 int num_commits_; |
2294 }; | 2293 }; |
2295 | 2294 |
2296 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 2295 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
2297 | 2296 |
2298 } // namespace | 2297 } // namespace |
2299 } // namespace cc | 2298 } // namespace cc |
OLD | NEW |