| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/public/cpp/bindings/lib/wtf_hash_util.h" | 5 #include "mojo/public/cpp/bindings/lib/wtf_hash_util.h" |
| 6 | 6 |
| 7 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom-blink.h" | 7 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom-blink.h" |
| 8 #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h" | 8 #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/WebKit/Source/wtf/HashFunctions.h" | 10 #include "third_party/WebKit/Source/wtf/HashFunctions.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 ASSERT_EQ(::mojo::internal::Hash(::mojo::internal::kHashSeed, | 30 ASSERT_EQ(::mojo::internal::Hash(::mojo::internal::kHashSeed, |
| 31 blink::UnmappedNativeStruct::New()), | 31 blink::UnmappedNativeStruct::New()), |
| 32 ::mojo::internal::Hash(::mojo::internal::kHashSeed, | 32 ::mojo::internal::Hash(::mojo::internal::kHashSeed, |
| 33 blink::UnmappedNativeStruct::New())); | 33 blink::UnmappedNativeStruct::New())); |
| 34 } | 34 } |
| 35 | 35 |
| 36 TEST_F(WTFHashTest, Enum) { | 36 TEST_F(WTFHashTest, Enum) { |
| 37 // Just check that this template instantiation compiles. | 37 // Just check that this template instantiation compiles. |
| 38 | 38 |
| 39 // Top-level. | 39 // Top-level. |
| 40 ASSERT_EQ(WTF::DefaultHash<blink::TopLevelEnum>::Hash().hash( | 40 ASSERT_EQ(WTF::DefaultHash<blink::TopLevelEnum>::Hash().GetHash( |
| 41 blink::TopLevelEnum::E0), | 41 blink::TopLevelEnum::E0), |
| 42 WTF::DefaultHash<blink::TopLevelEnum>::Hash().hash( | 42 WTF::DefaultHash<blink::TopLevelEnum>::Hash().GetHash( |
| 43 blink::TopLevelEnum::E0)); | 43 blink::TopLevelEnum::E0)); |
| 44 | 44 |
| 45 // Nested in struct. | 45 // Nested in struct. |
| 46 ASSERT_EQ(WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().hash( | 46 ASSERT_EQ(WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().GetHash( |
| 47 blink::TestWTFStruct::NestedEnum::E0), | 47 blink::TestWTFStruct::NestedEnum::E0), |
| 48 WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().hash( | 48 WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().GetHash( |
| 49 blink::TestWTFStruct::NestedEnum::E0)); | 49 blink::TestWTFStruct::NestedEnum::E0)); |
| 50 | 50 |
| 51 // Nested in interface. | 51 // Nested in interface. |
| 52 ASSERT_EQ(WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().hash( | 52 ASSERT_EQ(WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().GetHash( |
| 53 blink::TestWTF::NestedEnum::E0), | 53 blink::TestWTF::NestedEnum::E0), |
| 54 WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().hash( | 54 WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().GetHash( |
| 55 blink::TestWTF::NestedEnum::E0)); | 55 blink::TestWTF::NestedEnum::E0)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 } // namespace test | 59 } // namespace test |
| 60 } // namespace mojo | 60 } // namespace mojo |
| OLD | NEW |