Index: third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h |
diff --git a/third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h b/third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h |
index aadeed8d2815638ae3394371d05330a62baef6d7..9449ec7a70b79d13330e11722ce862a9948288fa 100644 |
--- a/third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h |
+++ b/third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h |
@@ -7,6 +7,7 @@ |
#include "base/test/fuzzed_data_provider.h" |
#include "wtf/Noncopyable.h" |
+#include "wtf/Vector.h" |
#include "wtf/text/CString.h" |
namespace blink { |
@@ -30,6 +31,11 @@ class FuzzedDataProvider { |
// Returns a bool, or false when no data remains. |
bool ConsumeBool(); |
+ template <typename Type> |
+ Type PickValueInVector(const Vector<Type>& vec) { |
+ return vec[m_provider.ConsumeUint32InRange(0, vec.size() - 1)]; |
+ } |
+ |
private: |
base::FuzzedDataProvider m_provider; |
}; |