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

Unified Diff: cc/surfaces/surface_unittest.cc

Issue 2382873002: Replace usage of SurfaceId's client_id with FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 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_sequence.h ('k') | cc/surfaces/surfaces_pixeltest.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 0fe4f7deda93f711c20276bf1634180b8c1d1619..6bbcc6672ebcc99969286740b955307e5dee5445 100644
--- a/cc/surfaces/surface_unittest.cc
+++ b/cc/surfaces/surface_unittest.cc
@@ -14,7 +14,7 @@
namespace cc {
namespace {
-static constexpr uint32_t kArbitraryClientId = 0;
+static constexpr FrameSinkId kArbitraryFrameSinkId(1, 1);
class FakeSurfaceFactoryClient : public SurfaceFactoryClient {
public:
@@ -37,7 +37,7 @@ TEST(SurfaceTest, SurfaceLifetime) {
FakeSurfaceFactoryClient surface_factory_client;
SurfaceFactory factory(&manager, &surface_factory_client);
- SurfaceId surface_id(kArbitraryClientId, 6, 0);
+ SurfaceId surface_id(kArbitraryFrameSinkId, 6, 0);
{
factory.Create(surface_id);
EXPECT_TRUE(manager.GetSurfaceForId(surface_id));
@@ -48,14 +48,15 @@ TEST(SurfaceTest, SurfaceLifetime) {
}
TEST(SurfaceTest, SurfaceIds) {
- uint32_t client_ids[] = {0u, 37u, ~0u};
+ FrameSinkId frame_sink_ids[] = {FrameSinkId(0, 0), FrameSinkId(37, 37),
+ FrameSinkId(1337, 1234)};
for (size_t i = 0; i < 3; ++i) {
- uint32_t client_id = client_ids[i];
- SurfaceIdAllocator allocator(client_id);
+ const FrameSinkId& frame_sink_id = frame_sink_ids[i];
+ SurfaceIdAllocator allocator(frame_sink_id);
SurfaceId id1 = allocator.GenerateId();
- EXPECT_EQ(id1.client_id(), client_id);
+ EXPECT_EQ(id1.frame_sink_id(), frame_sink_id);
SurfaceId id2 = allocator.GenerateId();
- EXPECT_EQ(id2.client_id(), client_id);
+ EXPECT_EQ(id2.frame_sink_id(), frame_sink_id);
EXPECT_NE(id1.local_id(), id2.local_id());
EXPECT_NE(id1.nonce(), id2.nonce());
}
« no previous file with comments | « cc/surfaces/surface_sequence.h ('k') | cc/surfaces/surfaces_pixeltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698