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

Unified Diff: media/blink/test_random.h

Issue 1762753002: Move test_random.h into media/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing #include Created 4 years, 10 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 | « media/blink/multibuffer_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/test_random.h
diff --git a/media/blink/test_random.h b/media/blink/test_random.h
deleted file mode 100644
index 8cc4211cf9cb9943d12f5d40009df317c73119bd..0000000000000000000000000000000000000000
--- a/media/blink/test_random.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 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.
-
-#ifndef MEDIA_BLINK_TEST_RANDOM_H_
-#define MEDIA_BLINK_TEST_RANDOM_H_
-
-#include <stdint.h>
-
-// Vastly simplified ACM random class meant to only be used for testing.
-// This class is meant to generate predictable sequences of pseudorandom
-// numbers, unlike the classes in base/rand_util.h which are meant to generate
-// unpredictable sequences.
-// See
-// https://code.google.com/p/szl/source/browse/trunk/src/utilities/acmrandom.h
-// for more information.
-
-namespace media {
-
-class TestRandom {
- public:
- explicit TestRandom(uint32_t seed) {
- seed_ = seed & 0x7fffffff; // make this a non-negative number
- if (seed_ == 0 || seed_ == M) {
- seed_ = 1;
- }
- }
-
- int32_t Rand() {
- static const uint64_t A = 16807; // bits 14, 8, 7, 5, 2, 1, 0
- seed_ = static_cast<int32_t>((seed_ * A) % M);
- CHECK_GT(seed_, 0);
- return seed_;
- }
-
- private:
- static const uint64_t M = 2147483647L; // 2^32-1
- int32_t seed_;
-};
-
-} // namespace media
-
-#endif // MEDIA_BLINK_TEST_RANDOM_H_
« no previous file with comments | « media/blink/multibuffer_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698