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

Side by Side Diff: media/filters/h264_bit_reader_unittest.cc

Issue 119153002: Move H264Parser and H264BitReader to media/filters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test-25fps.h264 to isolate Created 6 years, 12 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 "media/filters/h264_bit_reader.h"
5 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
6 7
7 #include "content/common/gpu/media/h264_bit_reader.h" 8 using media::H264BitReader;
scherkus (not reviewing) 2014/01/06 20:10:12 unless there's some strong reason not to, we typic
Pawel Osciak 2014/01/08 07:30:34 Done.
8
9 using content::H264BitReader;
10 9
11 TEST(H264BitReaderTest, ReadStreamWithoutEscapeAndTrailingZeroBytes) { 10 TEST(H264BitReaderTest, ReadStreamWithoutEscapeAndTrailingZeroBytes) {
12 H264BitReader reader; 11 H264BitReader reader;
13 const unsigned char rbsp[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xa0}; 12 const unsigned char rbsp[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xa0};
14 int dummy = 0; 13 int dummy = 0;
15 14
16 EXPECT_TRUE(reader.Initialize(rbsp, sizeof(rbsp))); 15 EXPECT_TRUE(reader.Initialize(rbsp, sizeof(rbsp)));
17 16
18 EXPECT_TRUE(reader.ReadBits(1, &dummy)); 17 EXPECT_TRUE(reader.ReadBits(1, &dummy));
19 EXPECT_EQ(dummy, 0x00); 18 EXPECT_EQ(dummy, 0x00);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 62
64 EXPECT_TRUE(reader.Initialize(rbsp, sizeof(rbsp))); 63 EXPECT_TRUE(reader.Initialize(rbsp, sizeof(rbsp)));
65 EXPECT_EQ(reader.NumBitsLeft(), 16); 64 EXPECT_EQ(reader.NumBitsLeft(), 16);
66 EXPECT_TRUE(reader.HasMoreRBSPData()); 65 EXPECT_TRUE(reader.HasMoreRBSPData());
67 66
68 EXPECT_TRUE(reader.ReadBits(8, &dummy)); 67 EXPECT_TRUE(reader.ReadBits(8, &dummy));
69 EXPECT_EQ(dummy, 0xab); 68 EXPECT_EQ(dummy, 0xab);
70 EXPECT_EQ(reader.NumBitsLeft(), 8); 69 EXPECT_EQ(reader.NumBitsLeft(), 8);
71 EXPECT_FALSE(reader.HasMoreRBSPData()); 70 EXPECT_FALSE(reader.HasMoreRBSPData());
72 } 71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698