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

Unified Diff: cc/surfaces/surface_unittest.cc

Issue 2136413002: Update Surface ID Terminology (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed webkit_unit_tests Created 4 years, 5 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
Index: cc/surfaces/surface_unittest.cc
diff --git a/cc/surfaces/surface_unittest.cc b/cc/surfaces/surface_unittest.cc
index d4ac06e8f464cc4a57e3a99c34c906de31eaf20e..0fe4f7deda93f711c20276bf1634180b8c1d1619 100644
--- a/cc/surfaces/surface_unittest.cc
+++ b/cc/surfaces/surface_unittest.cc
@@ -14,6 +14,8 @@
namespace cc {
namespace {
+static constexpr uint32_t kArbitraryClientId = 0;
+
class FakeSurfaceFactoryClient : public SurfaceFactoryClient {
public:
FakeSurfaceFactoryClient() : begin_frame_source_(nullptr) {}
@@ -35,7 +37,7 @@ TEST(SurfaceTest, SurfaceLifetime) {
FakeSurfaceFactoryClient surface_factory_client;
SurfaceFactory factory(&manager, &surface_factory_client);
- SurfaceId surface_id(0, 6, 0);
+ SurfaceId surface_id(kArbitraryClientId, 6, 0);
{
factory.Create(surface_id);
EXPECT_TRUE(manager.GetSurfaceForId(surface_id));
@@ -46,14 +48,14 @@ TEST(SurfaceTest, SurfaceLifetime) {
}
TEST(SurfaceTest, SurfaceIds) {
- uint32_t namespaces[] = {0u, 37u, ~0u};
+ uint32_t client_ids[] = {0u, 37u, ~0u};
for (size_t i = 0; i < 3; ++i) {
- uint32_t id_namespace = namespaces[i];
- SurfaceIdAllocator allocator(id_namespace);
+ uint32_t client_id = client_ids[i];
+ SurfaceIdAllocator allocator(client_id);
SurfaceId id1 = allocator.GenerateId();
- EXPECT_EQ(id1.id_namespace(), id_namespace);
+ EXPECT_EQ(id1.client_id(), client_id);
SurfaceId id2 = allocator.GenerateId();
- EXPECT_EQ(id2.id_namespace(), id_namespace);
+ EXPECT_EQ(id2.client_id(), client_id);
EXPECT_NE(id1.local_id(), id2.local_id());
EXPECT_NE(id1.nonce(), id2.nonce());
}

Powered by Google App Engine
This is Rietveld 408576698