| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/common/stream_parser_test_base.h" | 5 #include "media/formats/common/stream_parser_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "media/base/test_data_util.h" | 8 #include "media/base/test_data_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 scoped_ptr<StreamParser> stream_parser) | 31 scoped_ptr<StreamParser> stream_parser) |
| 32 : parser_(stream_parser.Pass()) { | 32 : parser_(stream_parser.Pass()) { |
| 33 parser_->Init( | 33 parser_->Init( |
| 34 base::Bind(&StreamParserTestBase::OnInitDone, base::Unretained(this)), | 34 base::Bind(&StreamParserTestBase::OnInitDone, base::Unretained(this)), |
| 35 base::Bind(&StreamParserTestBase::OnNewConfig, base::Unretained(this)), | 35 base::Bind(&StreamParserTestBase::OnNewConfig, base::Unretained(this)), |
| 36 base::Bind(&StreamParserTestBase::OnNewBuffers, base::Unretained(this)), | 36 base::Bind(&StreamParserTestBase::OnNewBuffers, base::Unretained(this)), |
| 37 true, | 37 true, |
| 38 base::Bind(&StreamParserTestBase::OnKeyNeeded, base::Unretained(this)), | 38 base::Bind(&StreamParserTestBase::OnKeyNeeded, base::Unretained(this)), |
| 39 base::Bind(&StreamParserTestBase::OnNewSegment, base::Unretained(this)), | 39 base::Bind(&StreamParserTestBase::OnNewSegment, base::Unretained(this)), |
| 40 base::Bind(&StreamParserTestBase::OnEndOfSegment, base::Unretained(this)), | 40 base::Bind(&StreamParserTestBase::OnEndOfSegment, base::Unretained(this)), |
| 41 LogCB()); | 41 new MediaLog()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 StreamParserTestBase::~StreamParserTestBase() {} | 44 StreamParserTestBase::~StreamParserTestBase() {} |
| 45 | 45 |
| 46 std::string StreamParserTestBase::ParseFile(const std::string& filename, | 46 std::string StreamParserTestBase::ParseFile(const std::string& filename, |
| 47 int append_bytes) { | 47 int append_bytes) { |
| 48 results_stream_.clear(); | 48 results_stream_.clear(); |
| 49 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); | 49 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); |
| 50 EXPECT_TRUE( | 50 EXPECT_TRUE( |
| 51 AppendDataInPieces(buffer->data(), buffer->data_size(), append_bytes)); | 51 AppendDataInPieces(buffer->data(), buffer->data_size(), append_bytes)); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DVLOG(1) << __FUNCTION__; | 118 DVLOG(1) << __FUNCTION__; |
| 119 results_stream_ << "NewSegment"; | 119 results_stream_ << "NewSegment"; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void StreamParserTestBase::OnEndOfSegment() { | 122 void StreamParserTestBase::OnEndOfSegment() { |
| 123 DVLOG(1) << __FUNCTION__; | 123 DVLOG(1) << __FUNCTION__; |
| 124 results_stream_ << "EndOfSegment"; | 124 results_stream_ << "EndOfSegment"; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace media | 127 } // namespace media |
| OLD | NEW |