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

Side by Side Diff: media/base/seekable_buffer_unittest.cc

Issue 661163004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/base/pipeline_unittest.cc ('k') | media/base/serial_runner_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <cstdlib> 5 #include <cstdlib>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/data_buffer.h" 10 #include "media/base/data_buffer.h"
11 #include "media/base/seekable_buffer.h" 11 #include "media/base/seekable_buffer.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace media { 14 namespace media {
15 15
16 class SeekableBufferTest : public testing::Test { 16 class SeekableBufferTest : public testing::Test {
17 public: 17 public:
18 SeekableBufferTest() : buffer_(kBufferSize, kBufferSize) { 18 SeekableBufferTest() : buffer_(kBufferSize, kBufferSize) {
19 } 19 }
20 20
21 protected: 21 protected:
22 static const int kDataSize = 409600; 22 static const int kDataSize = 409600;
23 static const int kBufferSize = 4096; 23 static const int kBufferSize = 4096;
24 static const int kWriteSize = 512; 24 static const int kWriteSize = 512;
25 25
26 virtual void SetUp() { 26 void SetUp() override {
27 // Note: We use srand() and rand() rather than base::RandXXX() to improve 27 // Note: We use srand() and rand() rather than base::RandXXX() to improve
28 // unit test performance. We don't need good random numbers, just 28 // unit test performance. We don't need good random numbers, just
29 // something that generates "mixed data." 29 // something that generates "mixed data."
30 const unsigned int kKnownSeed = 0x98765432; 30 const unsigned int kKnownSeed = 0x98765432;
31 srand(kKnownSeed); 31 srand(kKnownSeed);
32 32
33 // Create random test data samples. 33 // Create random test data samples.
34 for (int i = 0; i < kDataSize; i++) 34 for (int i = 0; i < kDataSize; i++)
35 data_[i] = static_cast<char>(rand()); 35 data_[i] = static_cast<char>(rand());
36 } 36 }
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 EXPECT_EQ(tests[i].expected_time, actual) << "With test = { start:" 346 EXPECT_EQ(tests[i].expected_time, actual) << "With test = { start:"
347 << tests[i].first_time_useconds << ", duration:" 347 << tests[i].first_time_useconds << ", duration:"
348 << tests[i].duration_useconds << ", consumed:" 348 << tests[i].duration_useconds << ", consumed:"
349 << tests[i].consume_bytes << " }\n"; 349 << tests[i].consume_bytes << " }\n";
350 350
351 buffer_.Clear(); 351 buffer_.Clear();
352 } 352 }
353 } 353 }
354 354
355 } // namespace media 355 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/base/serial_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698