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

Side by Side Diff: Source/platform/graphics/gpu/DrawingBufferTest.cpp

Issue 1316143002: Fix leaks in DrawingBufferTest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // Prepare another mailbox and verify that it's the correct size. 255 // Prepare another mailbox and verify that it's the correct size.
256 m_drawingBuffer->markContentsChanged(); 256 m_drawingBuffer->markContentsChanged();
257 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); 257 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
258 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); 258 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
259 259
260 // Prepare one final mailbox and verify that it's the correct size. 260 // Prepare one final mailbox and verify that it's the correct size.
261 m_drawingBuffer->mailboxReleased(mailbox, false); 261 m_drawingBuffer->mailboxReleased(mailbox, false);
262 m_drawingBuffer->markContentsChanged(); 262 m_drawingBuffer->markContentsChanged();
263 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); 263 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
264 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); 264 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
265 m_drawingBuffer->mailboxReleased(mailbox, false);
265 m_drawingBuffer->beginDestruction(); 266 m_drawingBuffer->beginDestruction();
266 } 267 }
267 268
268 TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased) 269 TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased)
269 { 270 {
270 bool live = true; 271 bool live = true;
271 m_drawingBuffer->m_live = &live; 272 m_drawingBuffer->m_live = &live;
272 273
273 WebExternalTextureMailbox mailbox1; 274 WebExternalTextureMailbox mailbox1;
274 WebExternalTextureMailbox mailbox2; 275 WebExternalTextureMailbox mailbox2;
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 mailbox.syncPoint = waitSyncPoint; 658 mailbox.syncPoint = waitSyncPoint;
658 m_drawingBuffer->setIsHidden(true); 659 m_drawingBuffer->setIsHidden(true);
659 m_drawingBuffer->mailboxReleased(mailbox); 660 m_drawingBuffer->mailboxReleased(mailbox);
660 // m_drawingBuffer deletes mailbox immediately when hidden. 661 // m_drawingBuffer deletes mailbox immediately when hidden.
661 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); 662 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
662 663
663 m_drawingBuffer->beginDestruction(); 664 m_drawingBuffer->beginDestruction();
664 } 665 }
665 666
666 } // namespace blink 667 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698