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..16dd88118cf47f6acd9953d2d2f4982b86949b00 100644 |
--- a/cc/layer_tree_host_unittest_context.cc |
+++ b/cc/layer_tree_host_unittest_context.cc |
@@ -780,5 +780,37 @@ class LayerTreeHostContextTestDontUseLostResources : |
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources) |
+class LayerTreeHostContextTestFailsImmediately : |
+ public LayerTreeHostContextTest { |
+ public: |
+ LayerTreeHostContextTestFailsImmediately() |
+ : LayerTreeHostContextTest() { |
+ } |
+ |
+ virtual ~LayerTreeHostContextTestFailsImmediately() {} |
+ |
+ virtual void beginTest() OVERRIDE { |
+ postSetNeedsCommitToMainThread(); |
+ } |
+ |
+ virtual void afterTest() OVERRIDE { |
+ } |
+ |
+ virtual scoped_ptr<FakeWebGraphicsContext3D> CreateContext3d() OVERRIDE { |
+ scoped_ptr<FakeWebGraphicsContext3D> context = |
+ LayerTreeHostContextTest::CreateContext3d(); |
+ context->loseContextCHROMIUM(); |
+ return context.Pass(); |
+ } |
+ |
+ virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { |
+ EXPECT_FALSE(succeeded); |
+ // If we make it this far without crashing, we pass! |
+ endTest(); |
+ } |
+}; |
+ |
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately); |
+ |
} // namespace |
} // namespace cc |