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

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

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
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 "base/string_util.h" 5 #include "base/string_util.h"
6 #include "media/base/buffers.h" 6 #include "media/base/buffers.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 namespace { 11 namespace {
12 12
13 // Simple implementation of Buffer to test base class functionality. 13 // Simple implementation of Buffer to test base class functionality.
14 class TestBuffer : public Buffer { 14 class TestBuffer : public Buffer {
15 public: 15 public:
16 TestBuffer() 16 TestBuffer()
17 : Buffer(base::TimeDelta(), base::TimeDelta()) { 17 : Buffer(base::TimeDelta(), base::TimeDelta()) {
18 } 18 }
19 19
20 // Sets |data_| and |size_| members for testing purposes. Does not take 20 // Sets |data_| and |size_| members for testing purposes. Does not take
21 // ownership of |data|. 21 // ownership of |data|.
22 TestBuffer(const uint8* data, int size) 22 TestBuffer(const uint8* data, int size)
23 : Buffer(base::TimeDelta(), base::TimeDelta()), 23 : Buffer(base::TimeDelta(), base::TimeDelta()),
24 data_(data), 24 data_(data),
25 size_(size) { 25 size_(size) {
26 } 26 }
27 27
28 virtual ~TestBuffer() {}
29
30 // Buffer implementation. 28 // Buffer implementation.
31 virtual const uint8* GetData() const OVERRIDE { return data_; } 29 virtual const uint8* GetData() const OVERRIDE { return data_; }
32 virtual int GetDataSize() const OVERRIDE { return size_; } 30 virtual int GetDataSize() const OVERRIDE { return size_; }
33 31
34 private: 32 private:
33 virtual ~TestBuffer() {}
34
35 const uint8* data_; 35 const uint8* data_;
36 int size_; 36 int size_;
37 37
38 DISALLOW_COPY_AND_ASSIGN(TestBuffer); 38 DISALLOW_COPY_AND_ASSIGN(TestBuffer);
39 }; 39 };
40 40
41 } // namespace 41 } // namespace
42 42
43 TEST(BufferTest, Timestamp) { 43 TEST(BufferTest, Timestamp) {
44 const base::TimeDelta kZero; 44 const base::TimeDelta kZero;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 buffer = new TestBuffer(kData, kDataSize); 80 buffer = new TestBuffer(kData, kDataSize);
81 EXPECT_FALSE(buffer->IsEndOfStream()); 81 EXPECT_FALSE(buffer->IsEndOfStream());
82 } 82 }
83 83
84 TEST(BufferTest, GetDecryptConfig) { 84 TEST(BufferTest, GetDecryptConfig) {
85 scoped_refptr<TestBuffer> buffer = new TestBuffer(); 85 scoped_refptr<TestBuffer> buffer = new TestBuffer();
86 EXPECT_FALSE(buffer->GetDecryptConfig()); 86 EXPECT_FALSE(buffer->GetDecryptConfig());
87 } 87 }
88 88
89 } // namespace media 89 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698