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

Unified Diff: test/unittests/test-utils.cc

Issue 624153003: Add C++11 compatible base::hash function object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: NodeCache Created 6 years, 2 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
« no previous file with comments | « test/unittests/test-utils.h ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « test/unittests/test-utils.h ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698