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

Unified Diff: cc/surfaces/surface_aggregator_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_aggregator_test_helpers.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator_unittest.cc
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index 1809409bef4a186440446ab0c9cfbc349f518ef8..aa5cea04c23f59cee1ee41840fe29c87d91f9cf9 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -19,7 +19,12 @@
namespace cc {
namespace {
-const int kInvalidSurfaceId = -1;
+
+SurfaceId InvalidSurfaceId() {
+ static SurfaceId invalid;
+ invalid.id = -1;
+ return invalid;
+}
class SurfaceAggregatorTest : public testing::Test {
public:
@@ -31,7 +36,7 @@ class SurfaceAggregatorTest : public testing::Test {
};
TEST_F(SurfaceAggregatorTest, InvalidSurfaceId) {
- scoped_ptr<CompositorFrame> frame = aggregator_.Aggregate(kInvalidSurfaceId);
+ scoped_ptr<CompositorFrame> frame = aggregator_.Aggregate(InvalidSurfaceId());
EXPECT_FALSE(frame);
}
@@ -258,7 +263,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, MultiPassSurfaceReference) {
// be dropped.
TEST_F(SurfaceAggregatorValidSurfaceTest, InvalidSurfaceReference) {
test::Quad quads[] = {test::Quad::SolidColorQuad(SK_ColorGREEN),
- test::Quad::SurfaceQuad(kInvalidSurfaceId),
+ test::Quad::SurfaceQuad(InvalidSurfaceId()),
test::Quad::SolidColorQuad(SK_ColorBLUE)};
test::Pass passes[] = {test::Pass(quads, arraysize(quads))};
« no previous file with comments | « cc/surfaces/surface_aggregator_test_helpers.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698