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

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

Issue 23205006: Define proprietary_codecs=1 when branding==Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto lkgr Created 7 years, 4 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
« no previous file with comments | « media/filters/audio_file_reader_unittest.cc ('k') | media/filters/pipeline_integration_test.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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 2007
2008 // Sanity check that data can be appended after this cluster correctly. 2008 // Sanity check that data can be appended after this cluster correctly.
2009 AppendCluster(GenerateCluster(0, 2)); 2009 AppendCluster(GenerateCluster(0, 2));
2010 ExpectRead(DemuxerStream::AUDIO, 0); 2010 ExpectRead(DemuxerStream::AUDIO, 0);
2011 ExpectRead(DemuxerStream::VIDEO, 0); 2011 ExpectRead(DemuxerStream::VIDEO, 0);
2012 } 2012 }
2013 2013
2014 TEST_F(ChunkDemuxerTest, CodecPrefixMatching) { 2014 TEST_F(ChunkDemuxerTest, CodecPrefixMatching) {
2015 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported; 2015 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported;
2016 2016
2017 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) 2017 #if defined(USE_PROPRIETARY_CODECS)
2018 expected = ChunkDemuxer::kOk; 2018 expected = ChunkDemuxer::kOk;
2019 #endif 2019 #endif
2020 2020
2021 std::vector<std::string> codecs; 2021 std::vector<std::string> codecs;
2022 codecs.push_back("avc1.4D4041"); 2022 codecs.push_back("avc1.4D4041");
2023 2023
2024 EXPECT_EQ(demuxer_->AddId("source_id", "video/mp4", codecs), expected); 2024 EXPECT_EQ(demuxer_->AddId("source_id", "video/mp4", codecs), expected);
2025 } 2025 }
2026 2026
2027 // Test codec ID's that are not compliant with RFC6381, but have been 2027 // Test codec ID's that are not compliant with RFC6381, but have been
2028 // seen in the wild. 2028 // seen in the wild.
2029 TEST_F(ChunkDemuxerTest, CodecIDsThatAreNotRFC6381Compliant) { 2029 TEST_F(ChunkDemuxerTest, CodecIDsThatAreNotRFC6381Compliant) {
2030 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported; 2030 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported;
2031 2031
2032 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) 2032 #if defined(USE_PROPRIETARY_CODECS)
2033 expected = ChunkDemuxer::kOk; 2033 expected = ChunkDemuxer::kOk;
2034 #endif 2034 #endif
2035 const char* codec_ids[] = { 2035 const char* codec_ids[] = {
2036 // GPAC places leading zeros on the audio object type. 2036 // GPAC places leading zeros on the audio object type.
2037 "mp4a.40.02", 2037 "mp4a.40.02",
2038 "mp4a.40.05" 2038 "mp4a.40.05"
2039 }; 2039 };
2040 2040
2041 for (size_t i = 0; i < arraysize(codec_ids); ++i) { 2041 for (size_t i = 0; i < arraysize(codec_ids); ++i) {
2042 std::vector<std::string> codecs; 2042 std::vector<std::string> codecs;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 2606
2607 TEST_F(ChunkDemuxerTest, StartWaitingForSeekAfterParseError) { 2607 TEST_F(ChunkDemuxerTest, StartWaitingForSeekAfterParseError) {
2608 ASSERT_TRUE(InitDemuxer(true, true)); 2608 ASSERT_TRUE(InitDemuxer(true, true));
2609 EXPECT_CALL(host_, OnDemuxerError(PIPELINE_ERROR_DECODE)); 2609 EXPECT_CALL(host_, OnDemuxerError(PIPELINE_ERROR_DECODE));
2610 AppendGarbage(); 2610 AppendGarbage();
2611 base::TimeDelta seek_time = base::TimeDelta::FromSeconds(50); 2611 base::TimeDelta seek_time = base::TimeDelta::FromSeconds(50);
2612 demuxer_->StartWaitingForSeek(seek_time); 2612 demuxer_->StartWaitingForSeek(seek_time);
2613 } 2613 }
2614 2614
2615 } // namespace media 2615 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_file_reader_unittest.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698