| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
| 6 #include "cc/output/gl_renderer.h" | 6 #include "cc/output/gl_renderer.h" |
| 7 #include "cc/output/output_surface.h" | 7 #include "cc/output/output_surface.h" |
| 8 #include "cc/test/fake_output_surface_client.h" | 8 #include "cc/test/fake_output_surface_client.h" |
| 9 #include "cc/test/fake_renderer_client.h" | 9 #include "cc/test/fake_renderer_client.h" |
| 10 #include "cc/test/test_context_provider.h" | 10 #include "cc/test/test_context_provider.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 scoped_refptr<MockContextProvider> context_provider_; | 76 scoped_refptr<MockContextProvider> context_provider_; |
| 77 scoped_ptr<OutputSurface> output_surface_; | 77 scoped_ptr<OutputSurface> output_surface_; |
| 78 scoped_ptr<ResourceProvider> resource_provider_; | 78 scoped_ptr<ResourceProvider> resource_provider_; |
| 79 scoped_ptr<Renderer> renderer_; | 79 scoped_ptr<Renderer> renderer_; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 typedef ::testing::Types<DelegatingRenderer, GLRenderer> RendererTypes; | 82 typedef ::testing::Types<DelegatingRenderer, GLRenderer> RendererTypes; |
| 83 TYPED_TEST_CASE(RendererTest, RendererTypes); | 83 TYPED_TEST_CASE(RendererTest, RendererTypes); |
| 84 | 84 |
| 85 TYPED_TEST(RendererTest, ContextPurgedWhenRendererBecomesInvisible) { | 85 TYPED_TEST(RendererTest, ContextPurgedWhenRendererBecomesInvisible) { |
| 86 EXPECT_CALL(*(this->context_provider_), DeleteCachedResources()).Times(1); | 86 EXPECT_CALL(*(this->context_provider_.get()), DeleteCachedResources()) |
| 87 .Times(1); |
| 87 | 88 |
| 88 EXPECT_TRUE(this->renderer_->visible()); | 89 EXPECT_TRUE(this->renderer_->visible()); |
| 89 this->renderer_->SetVisible(false); | 90 this->renderer_->SetVisible(false); |
| 90 EXPECT_FALSE(this->renderer_->visible()); | 91 EXPECT_FALSE(this->renderer_->visible()); |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace | 94 } // namespace |
| 94 } // namespace cc | 95 } // namespace cc |
| OLD | NEW |