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

Unified Diff: cc/surfaces/surface_unittest.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserCompositorOutputSurface owns;scheduler decides Created 4 years, 9 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 72070c6ddb9ad7bd75c557fd9c8cb208ffef9500..477d5f575362f57dcea0f0992a02620994c77183 100644
--- a/cc/surfaces/surface_unittest.cc
+++ b/cc/surfaces/surface_unittest.cc
@@ -5,6 +5,7 @@
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/test/scheduler_test_common.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -44,5 +45,18 @@ TEST(SurfaceTest, SurfaceLifetime) {
EXPECT_EQ(NULL, manager.GetSurfaceForId(surface_id));
}
+TEST(SurfaceTest, SurfaceIds) {
+ uint32_t namespaces[] = {0, 37, ~0};
+ for (size_t i = 0; i < 3; ++i) {
+ uint32_t id_namespace = namespaces[i];
+ SurfaceIdAllocator allocator(id_namespace);
+ SurfaceId id1 = allocator.GenerateId();
+ EXPECT_EQ(id1.id_namespace(), id_namespace);
+ SurfaceId id2 = allocator.GenerateId();
+ EXPECT_EQ(id2.id_namespace(), id_namespace);
+ EXPECT_NE(id1.id, id2.id);
+ }
+}
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698