Chromium Code Reviews| 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/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" |
| 9 #include "cc/delegated_renderer_layer.h" | 9 #include "cc/delegated_renderer_layer.h" |
| 10 #include "cc/delegated_renderer_layer_impl.h" | 10 #include "cc/delegated_renderer_layer_impl.h" |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 773 scoped_refptr<VideoFrame> hw_video_frame_; | 773 scoped_refptr<VideoFrame> hw_video_frame_; |
| 774 scoped_refptr<VideoFrame> scaled_hw_video_frame_; | 774 scoped_refptr<VideoFrame> scaled_hw_video_frame_; |
| 775 | 775 |
| 776 FakeVideoFrameProvider color_frame_provider_; | 776 FakeVideoFrameProvider color_frame_provider_; |
| 777 FakeVideoFrameProvider hw_frame_provider_; | 777 FakeVideoFrameProvider hw_frame_provider_; |
| 778 FakeVideoFrameProvider scaled_hw_frame_provider_; | 778 FakeVideoFrameProvider scaled_hw_frame_provider_; |
| 779 }; | 779 }; |
| 780 | 780 |
| 781 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources) | 781 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources) |
| 782 | 782 |
| 783 class FakeWebGraphicsContext3DMakeCurrentFails : | |
| 784 public FakeWebGraphicsContext3D { | |
| 785 public: | |
| 786 virtual bool makeContextCurrent() OVERRIDE { return false; } | |
| 787 }; | |
| 788 | |
| 789 class LayerTreeHostContextTestFailsImmediately : public ThreadedTest { | |
| 790 public: | |
| 791 LayerTreeHostContextTestFailsImmediately() | |
| 792 : ThreadedTest() { | |
| 793 } | |
| 794 | |
| 795 virtual void beginTest() OVERRIDE { | |
| 796 postSetNeedsCommitToMainThread(); | |
| 797 } | |
| 798 | |
| 799 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { | |
| 800 EXPECT_FALSE(succeeded); | |
| 801 // If we make it this far without crashing, we pass! | |
| 802 endTest(); | |
| 803 } | |
| 804 | |
| 805 virtual void afterTest() OVERRIDE { | |
| 806 } | |
| 807 | |
| 808 virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE { | |
| 809 scoped_ptr<WebGraphicsContext3D> context_3d( | |
| 810 new FakeWebGraphicsContext3DMakeCurrentFails); | |
|
danakj
2013/01/08 00:49:08
I think you could just create a FakeWebGraphicsCon
| |
| 811 return FakeOutputSurface::Create3d( | |
| 812 context_3d.Pass()).PassAs<OutputSurface>(); | |
| 813 } | |
| 814 }; | |
| 815 | |
| 816 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately); | |
| 817 | |
| 783 } // namespace | 818 } // namespace |
| 784 } // namespace cc | 819 } // namespace cc |
| OLD | NEW |