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

Unified Diff: components/exo/surface_unittest.cc

Issue 1467943002: exo: Handle lost context situations properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move SharedMainThreadContextProvider Created 5 years, 1 month 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 | « components/exo/surface.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface_unittest.cc
diff --git a/components/exo/surface_unittest.cc b/components/exo/surface_unittest.cc
index f867a8d3218f8027f859f5af23d81915cd6e654c..e38cd6c2890ae5da9959b2d17d0aa7863bad69d5 100644
--- a/components/exo/surface_unittest.cc
+++ b/components/exo/surface_unittest.cc
@@ -32,23 +32,21 @@ TEST_F(SurfaceTest, Attach) {
buffer->set_release_callback(
base::Bind(&ReleaseBuffer, base::Unretained(&release_buffer_call_count)));
- scoped_ptr<Surface> surface1(new Surface);
- scoped_ptr<Surface> surface2(new Surface);
+ scoped_ptr<Surface> surface(new Surface);
// Attach the buffer to surface1.
- surface1->Attach(buffer.get());
- surface1->Commit();
+ surface->Attach(buffer.get());
+ surface->Commit();
- // Attaching buffer to surface2 when it is already attached to surface1
- // should fail and buffer should remain attached to surface1.
- surface2->Attach(buffer.get());
- surface2->Commit();
+ // Commit without calling Attach() should have no effect.
+ surface->Commit();
+ EXPECT_EQ(0, release_buffer_call_count);
- // Attach a null buffer to surface1, this should release the previously
+ // Attach a null buffer to surface, this should release the previously
// attached buffer.
- surface1->Attach(nullptr);
- surface1->Commit();
- ASSERT_EQ(release_buffer_call_count, 1);
+ surface->Attach(nullptr);
+ surface->Commit();
+ ASSERT_EQ(1, release_buffer_call_count);
}
TEST_F(SurfaceTest, Damage) {
« no previous file with comments | « components/exo/surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698