Chromium Code Reviews| 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..a2c309a017ecac2f88bb6da510958163729cf85c |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
pdr.
2017/05/08 22:01:49
2017
chrishtr
2017/05/09 04:22:31
Done.
|
| +// 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, kPrimary); |
| + EXPECT_EQ(1, DomNodeIdFromCompositorElementId(element_id)); |
| + EXPECT_EQ(kPrimary, SubElementIdFromCompositorElementId(element_id)); |
| + |
| + element_id = CreateCompositorElementId(1, kLinkHighlight); |
| + EXPECT_EQ(1, DomNodeIdFromCompositorElementId(element_id)); |
| + EXPECT_EQ(kLinkHighlight, SubElementIdFromCompositorElementId(element_id)); |
| + |
| + element_id = CreateCompositorElementId(23, kScroll); |
| + EXPECT_EQ(23, DomNodeIdFromCompositorElementId(element_id)); |
| + EXPECT_EQ(kScroll, SubElementIdFromCompositorElementId(element_id)); |
| +} |
| + |
| +} // namespace blink |