summaryrefslogtreecommitdiffstats
path: root/media/mp4/es_descriptor_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/mp4/es_descriptor_unittest.cc')
-rw-r--r--media/mp4/es_descriptor_unittest.cc92
1 files changed, 0 insertions, 92 deletions
diff --git a/media/mp4/es_descriptor_unittest.cc b/media/mp4/es_descriptor_unittest.cc
deleted file mode 100644
index c3a39fb..0000000
--- a/media/mp4/es_descriptor_unittest.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "media/mp4/es_descriptor.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace media {
-
-namespace mp4 {
-
-TEST(ESDescriptorTest, SingleByteLengthTest) {
- ESDescriptor es_desc;
- uint8 buffer[] = {
- 0x03, 0x19, 0x00, 0x01, 0x00, 0x04, 0x11, 0x40,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x12, 0x10,
- 0x06, 0x01, 0x02
- };
- std::vector<uint8> data;
-
- data.assign(buffer, buffer + sizeof(buffer));
-
- EXPECT_EQ(es_desc.object_type(), kForbidden);
- EXPECT_TRUE(es_desc.Parse(data));
- EXPECT_EQ(es_desc.object_type(), kISO_14496_3);
- EXPECT_EQ(es_desc.decoder_specific_info().size(), 2u);
- EXPECT_EQ(es_desc.decoder_specific_info()[0], 0x12);
- EXPECT_EQ(es_desc.decoder_specific_info()[1], 0x10);
-}
-
-TEST(ESDescriptorTest, NonAACTest) {
- ESDescriptor es_desc;
- uint8 buffer[] = {
- 0x03, 0x19, 0x00, 0x01, 0x00, 0x04, 0x11, 0x66,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x12, 0x10,
- 0x06, 0x01, 0x02
- };
- std::vector<uint8> data;
-
- data.assign(buffer, buffer + sizeof(buffer));
-
- EXPECT_TRUE(es_desc.Parse(data));
- EXPECT_NE(es_desc.object_type(), kISO_14496_3);
- EXPECT_EQ(es_desc.decoder_specific_info().size(), 2u);
- EXPECT_EQ(es_desc.decoder_specific_info()[0], 0x12);
- EXPECT_EQ(es_desc.decoder_specific_info()[1], 0x10);
-}
-
-TEST(ESDescriptorTest, MultiByteLengthTest) {
- ESDescriptor es_desc;
- uint8 buffer[] = {
- 0x03, 0x80, 0x19, 0x00, 0x01, 0x00, 0x04, 0x80,
- 0x80, 0x11, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
- 0x80, 0x80, 0x80, 0x02, 0x12, 0x10, 0x06, 0x01,
- 0x02
- };
- std::vector<uint8> data;
-
- data.assign(buffer, buffer + sizeof(buffer));
-
- EXPECT_TRUE(es_desc.Parse(data));
- EXPECT_EQ(es_desc.object_type(), kISO_14496_3);
- EXPECT_EQ(es_desc.decoder_specific_info().size(), 2u);
- EXPECT_EQ(es_desc.decoder_specific_info()[0], 0x12);
- EXPECT_EQ(es_desc.decoder_specific_info()[1], 0x10);
-}
-
-TEST(ESDescriptorTest, FiveByteLengthTest) {
- ESDescriptor es_desc;
- uint8 buffer[] = {
- 0x03, 0x80, 0x19, 0x00, 0x01, 0x00, 0x04, 0x80,
- 0x80, 0x11, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
- 0x80, 0x80, 0x80, 0x80, 0x02, 0x12, 0x10, 0x06,
- 0x01, 0x02
- };
- std::vector<uint8> data;
-
- data.assign(buffer, buffer + sizeof(buffer));
-
- EXPECT_TRUE(es_desc.Parse(data));
- EXPECT_EQ(es_desc.object_type(), kISO_14496_3);
- EXPECT_EQ(es_desc.decoder_specific_info().size(), 0u);
-}
-
-} // namespace mp4
-
-} // namespace media