Index: third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2878ab35c613ca7bc6bfe69fd517604c1972cbf6 |
--- /dev/null |
+++ b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp |
@@ -0,0 +1,28 @@ |
+// Copyright (c) 2017 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 "bindings/core/v8/NativeValueTraits.h" |
+ |
+#include <type_traits> |
+#include "bindings/core/v8/IDLTypesBase.h" |
+ |
+// No gtest tests; only static_assert checks. |
+ |
+namespace blink { |
+ |
+template <> |
+struct NativeValueTraits<bool> : public NativeValueTraitsBase<bool> {}; |
+ |
+static_assert(std::is_same<NativeValueTraits<bool>::ImplType, bool>::value, |
+ "NativeValueTraitsBase works with non IDLBase-derived types"); |
+ |
+struct MyIDLType final : public IDLBaseHelper<char> {}; |
+template <> |
+struct NativeValueTraits<MyIDLType> : public NativeValueTraitsBase<MyIDLType> { |
+}; |
+ |
+static_assert(std::is_same<NativeValueTraits<MyIDLType>::ImplType, char>::value, |
+ "NativeValueTraitsBase works with IDLBase-derived types"); |
+ |
+} // namespace blink |