| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 63   const uint8* end = data + length; | 63   const uint8* end = data + length; | 
| 64   while (start < end) { | 64   while (start < end) { | 
| 65     size_t append_size = std::min(piece_size, static_cast<size_t>(end - start)); | 65     size_t append_size = std::min(piece_size, static_cast<size_t>(end - start)); | 
| 66     if (!parser_->Parse(start, append_size)) | 66     if (!parser_->Parse(start, append_size)) | 
| 67       return false; | 67       return false; | 
| 68     start += append_size; | 68     start += append_size; | 
| 69   } | 69   } | 
| 70   return true; | 70   return true; | 
| 71 } | 71 } | 
| 72 | 72 | 
| 73 void StreamParserTestBase::OnInitDone(bool success, base::TimeDelta duration) { | 73 void StreamParserTestBase::OnInitDone(bool success, | 
|  | 74                                       base::TimeDelta duration, | 
|  | 75                                       bool auto_update_timestamp_offset) { | 
|  | 76   EXPECT_TRUE(auto_update_timestamp_offset); | 
| 74   DVLOG(1) << __FUNCTION__ << "(" << success << ", " | 77   DVLOG(1) << __FUNCTION__ << "(" << success << ", " | 
| 75            << duration.InMilliseconds() << ")"; | 78            << duration.InMilliseconds() << ", " << auto_update_timestamp_offset | 
|  | 79            << ")"; | 
| 76 } | 80 } | 
| 77 | 81 | 
| 78 bool StreamParserTestBase::OnNewConfig( | 82 bool StreamParserTestBase::OnNewConfig( | 
| 79     const AudioDecoderConfig& audio_config, | 83     const AudioDecoderConfig& audio_config, | 
| 80     const VideoDecoderConfig& video_config, | 84     const VideoDecoderConfig& video_config, | 
| 81     const StreamParser::TextTrackConfigMap& text_config) { | 85     const StreamParser::TextTrackConfigMap& text_config) { | 
| 82   DVLOG(1) << __FUNCTION__ << "(" << audio_config.IsValidConfig() << ", " | 86   DVLOG(1) << __FUNCTION__ << "(" << audio_config.IsValidConfig() << ", " | 
| 83            << video_config.IsValidConfig() << ")"; | 87            << video_config.IsValidConfig() << ")"; | 
| 84   EXPECT_TRUE(audio_config.IsValidConfig()); | 88   EXPECT_TRUE(audio_config.IsValidConfig()); | 
| 85   EXPECT_FALSE(video_config.IsValidConfig()); | 89   EXPECT_FALSE(video_config.IsValidConfig()); | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 112   DVLOG(1) << __FUNCTION__; | 116   DVLOG(1) << __FUNCTION__; | 
| 113   results_stream_ << "NewSegment"; | 117   results_stream_ << "NewSegment"; | 
| 114 } | 118 } | 
| 115 | 119 | 
| 116 void StreamParserTestBase::OnEndOfSegment() { | 120 void StreamParserTestBase::OnEndOfSegment() { | 
| 117   DVLOG(1) << __FUNCTION__; | 121   DVLOG(1) << __FUNCTION__; | 
| 118   results_stream_ << "EndOfSegment"; | 122   results_stream_ << "EndOfSegment"; | 
| 119 } | 123 } | 
| 120 | 124 | 
| 121 }  // namespace media | 125 }  // namespace media | 
| OLD | NEW | 
|---|