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

Side by Side Diff: media/blink/interval_map_unittest.cc

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, 9 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 unified diff | Download patch
« no previous file with comments | « media/blink/BUILD.gn ('k') | media/blink/lru_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "media/base/test_random.h"
10 #include "media/blink/interval_map.h" 11 #include "media/blink/interval_map.h"
11 #include "media/blink/test_random.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Our tests only modifiy the interval map entries in [0..kTestSize). 16 // Our tests only modifiy the interval map entries in [0..kTestSize).
17 // We need this to be big enough to hit tricky corner cases, but small 17 // We need this to be big enough to hit tricky corner cases, but small
18 // enough that we get lots of entry duplication to clean up. 18 // enough that we get lots of entry duplication to clean up.
19 // Also, SimpleIntervalMap uses a vector of size kTestSize to emulate 19 // Also, SimpleIntervalMap uses a vector of size kTestSize to emulate
20 // a intervalmap, so making this too big will the test down a lot. 20 // a intervalmap, so making this too big will the test down a lot.
21 const int kTestSize = 16; 21 const int kTestSize = 16;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 for (int i = 0; i < 200; i++) { 263 for (int i = 0; i < 200; i++) {
264 int32_t begin = rnd_.Rand() % (kTestSize - 1); 264 int32_t begin = rnd_.Rand() % (kTestSize - 1);
265 int32_t end = begin + 1 + rnd_.Rand() % (kTestSize - begin - 1); 265 int32_t end = begin + 1 + rnd_.Rand() % (kTestSize - begin - 1);
266 SetInterval(begin, end, rnd_.Rand() & 3); 266 SetInterval(begin, end, rnd_.Rand() & 3);
267 if (HasFailure()) { 267 if (HasFailure()) {
268 return; 268 return;
269 } 269 }
270 } 270 }
271 } 271 }
272 } 272 }
OLDNEW
« no previous file with comments | « media/blink/BUILD.gn ('k') | media/blink/lru_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698