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

Unified Diff: cc/surfaces/surface_unittest.cc

Issue 331533002: Use a struct for cc::Surface ids for more type safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add is_null and explicit ctor Created 6 years, 6 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 | « cc/surfaces/surface_manager.cc ('k') | content/browser/compositor/surface_display_output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_unittest.cc
diff --git a/cc/surfaces/surface_unittest.cc b/cc/surfaces/surface_unittest.cc
index 7b185125ab9deda6325284b5a43cfa505c1ab065..df41083e0168aeb0e344fc1040f2a23d27ae7b4f 100644
--- a/cc/surfaces/surface_unittest.cc
+++ b/cc/surfaces/surface_unittest.cc
@@ -13,15 +13,15 @@ namespace {
TEST(SurfaceTest, SurfaceLifetime) {
SurfaceManager manager;
- int surface_id = 0;
+ SurfaceId surface_id;
{
Surface surface(&manager, NULL, gfx::Size(5, 5));
surface_id = surface.surface_id();
- EXPECT_GT(surface_id, 0);
- EXPECT_EQ(&surface, manager.GetSurfaceForID(surface_id));
+ EXPECT_TRUE(!surface_id.is_null());
+ EXPECT_EQ(&surface, manager.GetSurfaceForId(surface_id));
}
- EXPECT_EQ(NULL, manager.GetSurfaceForID(surface_id));
+ EXPECT_EQ(NULL, manager.GetSurfaceForId(surface_id));
}
} // namespace
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | content/browser/compositor/surface_display_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698