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

Unified Diff: media/base/android/sdk_media_codec_bridge_unittest.cc

Issue 1601863002: Remove non-batching assumptions from SdkMediaCodecBridgeTest.DoNormal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed clang build by using constants Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/sdk_media_codec_bridge_unittest.cc
diff --git a/media/base/android/sdk_media_codec_bridge_unittest.cc b/media/base/android/sdk_media_codec_bridge_unittest.cc
index ef32acf684fecbc2479db94e43d84870c6b2bc6d..6ce42454f079fa18362da88814b75be20563afdd 100644
--- a/media/base/android/sdk_media_codec_bridge_unittest.cc
+++ b/media/base/android/sdk_media_codec_bridge_unittest.cc
@@ -90,6 +90,7 @@ unsigned char test_mp3[] = {
0x8a, 0xb3, 0x52, 0xd1, 0x3d, 0x79, 0x81, 0x4d, 0x31, 0x24, 0xf9, 0x38,
0x96, 0xbc, 0xf4, 0x8c, 0x25, 0xe9, 0xf2, 0x73, 0x94, 0x85, 0xc2, 0x61,
0x6a, 0x34, 0x68, 0x65, 0x78, 0x87, 0xa6, 0x4f};
+static const size_t kDecodedAudioLengthInBytes = 9216u;
} // namespace
@@ -105,6 +106,7 @@ namespace media {
} while (0)
static const int kPresentationTimeBase = 100;
+static const int kMaxInputPts = kPresentationTimeBase + 2;
static inline const base::TimeDelta InfiniteTimeOut() {
return base::TimeDelta::FromMicroseconds(-1);
@@ -181,6 +183,7 @@ TEST(SdkMediaCodecBridgeTest, DoNormal) {
input_pts = kPresentationTimeBase;
bool eos = false;
+ size_t total_size = 0;
while (!eos) {
size_t unused_offset = 0;
size_t size = 0;
@@ -205,11 +208,10 @@ TEST(SdkMediaCodecBridgeTest, DoNormal) {
}
ASSERT_GE(output_buf_index, 0);
EXPECT_LE(1u, size);
- if (!eos)
- EXPECT_EQ(++input_pts, timestamp.InMicroseconds());
- ASSERT_LE(input_pts, kPresentationTimeBase + 2);
+ total_size += size;
}
- ASSERT_EQ(input_pts, kPresentationTimeBase + 2);
+ EXPECT_EQ(kDecodedAudioLengthInBytes, total_size);
+ ASSERT_LE(input_pts, kMaxInputPts);
}
TEST(SdkMediaCodecBridgeTest, InvalidVorbisHeader) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698