Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: trunk/Source/web/tests/DrawingBufferTest.cpp

Issue 184343005: Revert 168457 "WebGL: Transfer ownership of WebGraphicsContext3D..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/platform/graphics/gpu/DrawingBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/web/tests/DrawingBufferTest.cpp
===================================================================
--- trunk/Source/web/tests/DrawingBufferTest.cpp (revision 168480)
+++ trunk/Source/web/tests/DrawingBufferTest.cpp (working copy)
@@ -112,17 +112,16 @@
virtual void SetUp()
{
RefPtr<FakeContextEvictionManager> contextEvictionManager = adoptRef(new FakeContextEvictionManager());
- OwnPtr<WebGraphicsContext3DForTests> context = adoptPtr(new WebGraphicsContext3DForTests);
- m_context = context.get();
- m_drawingBuffer = DrawingBuffer::create(context.release(), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve, contextEvictionManager.release());
+ m_context = adoptPtr(new WebGraphicsContext3DForTests);
+ m_drawingBuffer = DrawingBuffer::create(m_context.get(), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve, contextEvictionManager.release());
}
WebGraphicsContext3DForTests* webContext()
{
- return m_context;
+ return m_context.get();
}
- WebGraphicsContext3DForTests* m_context;
+ OwnPtr<WebGraphicsContext3DForTests> m_context;
RefPtr<DrawingBuffer> m_drawingBuffer;
};
@@ -142,6 +141,16 @@
EXPECT_FALSE(imageBuffer->bitmap().isNull());
}
+TEST_F(DrawingBufferTest, verifyNoNewBuffersAfterContextLostWithMailboxes)
+{
+ // Tell the buffer its contents changed and context was lost.
+ m_drawingBuffer->markContentsChanged();
+ m_drawingBuffer->releaseResources();
+
+ blink::WebExternalTextureMailbox mailbox;
+ EXPECT_FALSE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+}
+
TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes)
{
blink::WebExternalTextureMailbox mailbox;
« no previous file with comments | « trunk/Source/platform/graphics/gpu/DrawingBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698