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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Move specialization for SerializedScriptValue to the appropriate header Created 3 years, 9 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/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

Powered by Google App Engine
This is Rietveld 408576698