Index: test/unittests/test-utils.cc |
diff --git a/test/unittests/test-utils.cc b/test/unittests/test-utils.cc |
index a3532dd59aa2a7bf0c4394a3297c0a222332bc60..e6efef36f985a7dd846647e133874d3519187b13 100644 |
--- a/test/unittests/test-utils.cc |
+++ b/test/unittests/test-utils.cc |
@@ -4,6 +4,8 @@ |
#include "test/unittests/test-utils.h" |
+#include "src/base/platform/time.h" |
+#include "src/flags.h" |
#include "src/isolate-inl.h" |
namespace v8 { |
@@ -44,6 +46,24 @@ TestWithContext::TestWithContext() |
TestWithContext::~TestWithContext() {} |
+namespace base { |
+namespace { |
+ |
+inline int64_t GetRandomSeedFromFlag(int random_seed) { |
+ return random_seed ? random_seed : TimeTicks::Now().ToInternalValue(); |
+} |
+ |
+} // namespace |
+ |
+TestWithRandomNumberGenerator::TestWithRandomNumberGenerator() |
+ : rng_(GetRandomSeedFromFlag(internal::FLAG_random_seed)) {} |
+ |
+ |
+TestWithRandomNumberGenerator::~TestWithRandomNumberGenerator() {} |
+ |
+} // namespace base |
+ |
+ |
namespace internal { |
TestWithIsolate::~TestWithIsolate() {} |