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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp

Issue 2860293002: Change cc::ElementId to be a uint64_t (Closed)
Patch Set: Merge branch 'master' into secondaryid Created 3 years, 7 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: third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e0e812bedc6bfa5f14ff6cd86de4c01842bb9fac
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/graphics/CompositorElementId.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+class CompositorElementIdTest : public ::testing::Test {};
+
+TEST_F(CompositorElementIdTest, EncodeDecode) {
+ CompositorElementId element_id =
+ CreateCompositorElementId(1, CompositorSubElementId::kPrimary);
+ EXPECT_EQ(1u, DomNodeIdFromCompositorElementId(element_id));
+ EXPECT_EQ(CompositorSubElementId::kPrimary,
+ SubElementIdFromCompositorElementId(element_id));
+
+ element_id =
+ CreateCompositorElementId(1, CompositorSubElementId::kLinkHighlight);
+ EXPECT_EQ(1u, DomNodeIdFromCompositorElementId(element_id));
+ EXPECT_EQ(CompositorSubElementId::kLinkHighlight,
+ SubElementIdFromCompositorElementId(element_id));
+
+ element_id = CreateCompositorElementId(23, CompositorSubElementId::kScroll);
+ EXPECT_EQ(23u, DomNodeIdFromCompositorElementId(element_id));
+ EXPECT_EQ(CompositorSubElementId::kScroll,
+ SubElementIdFromCompositorElementId(element_id));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698