OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "platform/graphics/CompositorElementId.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 class CompositorElementIdTest : public ::testing::Test {}; |
| 12 |
| 13 TEST_F(CompositorElementIdTest, EncodeDecode) { |
| 14 CompositorElementId element_id = |
| 15 CreateCompositorElementId(1, CompositorSubElementId::kPrimary); |
| 16 EXPECT_EQ(1u, DomNodeIdFromCompositorElementId(element_id)); |
| 17 EXPECT_EQ(CompositorSubElementId::kPrimary, |
| 18 SubElementIdFromCompositorElementId(element_id)); |
| 19 |
| 20 element_id = |
| 21 CreateCompositorElementId(1, CompositorSubElementId::kLinkHighlight); |
| 22 EXPECT_EQ(1u, DomNodeIdFromCompositorElementId(element_id)); |
| 23 EXPECT_EQ(CompositorSubElementId::kLinkHighlight, |
| 24 SubElementIdFromCompositorElementId(element_id)); |
| 25 |
| 26 element_id = CreateCompositorElementId(23, CompositorSubElementId::kScroll); |
| 27 EXPECT_EQ(23u, DomNodeIdFromCompositorElementId(element_id)); |
| 28 EXPECT_EQ(CompositorSubElementId::kScroll, |
| 29 SubElementIdFromCompositorElementId(element_id)); |
| 30 } |
| 31 |
| 32 } // namespace blink |
OLD | NEW |