Commit 55f6ab39 authored by jamesr@chromium.org's avatar jamesr@chromium.org

ThreadedTest that a non-null OutputSurface that fails initialization immediately doesn't crash

Unit test to catch things like bug 168691

BUG=


Review URL: https://chromiumcodereview.appspot.com/11782026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175632 0039d316-1c4b-4281-b951-d872f2087c98
parent 6b519b35
......@@ -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
......@@ -1013,7 +1013,8 @@ bool ThreadProxy::commitPendingForTesting()
void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* request)
{
DCHECK(isImplThread());
request->commitPending = m_schedulerOnImplThread->commitPending();
if (m_layerTreeHostImpl->outputSurface())
request->commitPending = m_schedulerOnImplThread->commitPending();
request->completion.signal();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment