Index: third_party/WebKit/Source/wtf/VectorTest.cpp |
diff --git a/third_party/WebKit/Source/wtf/VectorTest.cpp b/third_party/WebKit/Source/wtf/VectorTest.cpp |
index 74b08ca5bdc19e93e4113672f360496a65966b2a..aa7509b11586e4ed79b13f43e3ca1f5165a11aa1 100644 |
--- a/third_party/WebKit/Source/wtf/VectorTest.cpp |
+++ b/third_party/WebKit/Source/wtf/VectorTest.cpp |
@@ -27,6 +27,7 @@ |
#include "testing/gtest/include/gtest/gtest.h" |
#include "wtf/HashSet.h" |
+#include "wtf/Optional.h" |
#include "wtf/PtrUtil.h" |
#include "wtf/text/WTFString.h" |
#include <memory> |
@@ -688,6 +689,15 @@ TEST(VectorTest, InitializerList) |
EXPECT_EQ(3, vector3[2]); |
} |
+TEST(VectorTest, Optional) |
+{ |
+ Optional<Vector<int>> vector; |
+ EXPECT_FALSE(vector); |
+ vector.emplace(3); |
+ EXPECT_TRUE(vector); |
+ EXPECT_EQ(3u, vector->size()); |
+} |
+ |
static_assert(VectorTraits<int>::canCopyWithMemcpy, "int should be copied with memcopy."); |
static_assert(VectorTraits<char>::canCopyWithMemcpy, "char should be copied with memcpy."); |
static_assert(VectorTraits<LChar>::canCopyWithMemcpy, "LChar should be copied with memcpy."); |