Index: cc/layer_tree_host_unittest_context.cc |
diff --git a/cc/layer_tree_host_unittest_context.cc b/cc/layer_tree_host_unittest_context.cc |
index 4e93ca80967a2017ebbc375b149b7e8d89b882c4..71648398071c7cc5c54fd7422c3efd318176ea61 100644 |
--- a/cc/layer_tree_host_unittest_context.cc |
+++ b/cc/layer_tree_host_unittest_context.cc |
@@ -780,5 +780,40 @@ class LayerTreeHostContextTestDontUseLostResources : |
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources) |
+class FakeWebGraphicsContext3DMakeCurrentFails : |
+ public FakeWebGraphicsContext3D { |
+ public: |
+ virtual bool makeContextCurrent() OVERRIDE { return false; } |
+}; |
+ |
+class LayerTreeHostContextTestFailsImmediately : public ThreadedTest { |
+ public: |
+ LayerTreeHostContextTestFailsImmediately() |
+ : ThreadedTest() { |
+ } |
+ |
+ virtual void beginTest() OVERRIDE { |
+ postSetNeedsCommitToMainThread(); |
+ } |
+ |
+ virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { |
+ EXPECT_FALSE(succeeded); |
+ // If we make it this far without crashing, we pass! |
+ endTest(); |
+ } |
+ |
+ virtual void afterTest() OVERRIDE { |
+ } |
+ |
+ virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE { |
+ scoped_ptr<WebGraphicsContext3D> context_3d( |
+ new FakeWebGraphicsContext3DMakeCurrentFails); |
danakj
2013/01/08 00:49:08
I think you could just create a FakeWebGraphicsCon
|
+ return FakeOutputSurface::Create3d( |
+ context_3d.Pass()).PassAs<OutputSurface>(); |
+ } |
+}; |
+ |
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately); |
+ |
} // namespace |
} // namespace cc |