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

Unified Diff: media/base/seekable_buffer_unittest.cc

Issue 10342005: media::SeekableBuffer should use kNoTimestamp() instead of zero. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « media/base/seekable_buffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/seekable_buffer_unittest.cc
diff --git a/media/base/seekable_buffer_unittest.cc b/media/base/seekable_buffer_unittest.cc
index 8d2e1dc58e10ca4c2b4e7f20829e5f82409b2c84..cc8cd0906d482032a3f4e78c52caf6d10660848f 100644
--- a/media/base/seekable_buffer_unittest.cc
+++ b/media/base/seekable_buffer_unittest.cc
@@ -291,22 +291,31 @@ TEST_F(SeekableBufferTest, AllMethods) {
TEST_F(SeekableBufferTest, GetTime) {
+ const int64 kNoTS = kNoTimestamp().ToInternalValue();
const struct {
int64 first_time_useconds;
int64 duration_useconds;
int consume_bytes;
int64 expected_time;
} tests[] = {
- // Timestamps of 0 are treated as garbage.
- { 0, 1000000, 0, kNoTimestamp().ToInternalValue() },
- { 0, 4000000, 0, kNoTimestamp().ToInternalValue() },
- { 0, 8000000, 0, kNoTimestamp().ToInternalValue() },
- { 0, 1000000, 4, kNoTimestamp().ToInternalValue() },
- { 0, 4000000, 4, kNoTimestamp().ToInternalValue() },
- { 0, 8000000, 4, kNoTimestamp().ToInternalValue() },
- { 0, 1000000, kWriteSize, kNoTimestamp().ToInternalValue() },
- { 0, 4000000, kWriteSize, kNoTimestamp().ToInternalValue() },
- { 0, 8000000, kWriteSize, kNoTimestamp().ToInternalValue() },
+ { kNoTS, 1000000, 0, kNoTS },
+ { kNoTS, 4000000, 0, kNoTS },
+ { kNoTS, 8000000, 0, kNoTS },
+ { kNoTS, 1000000, kWriteSize / 2, kNoTS },
+ { kNoTS, 4000000, kWriteSize / 2, kNoTS },
+ { kNoTS, 8000000, kWriteSize / 2, kNoTS },
+ { kNoTS, 1000000, kWriteSize, kNoTS },
+ { kNoTS, 4000000, kWriteSize, kNoTS },
+ { kNoTS, 8000000, kWriteSize, kNoTS },
+ { 0, 1000000, 0, 0 },
+ { 0, 4000000, 0, 0 },
+ { 0, 8000000, 0, 0 },
+ { 0, 1000000, kWriteSize / 2, 500000 },
+ { 0, 4000000, kWriteSize / 2, 2000000 },
+ { 0, 8000000, kWriteSize / 2, 4000000 },
+ { 0, 1000000, kWriteSize, 1000000 },
+ { 0, 4000000, kWriteSize, 4000000 },
+ { 0, 8000000, kWriteSize, 8000000 },
{ 5, 1000000, 0, 5 },
{ 5, 4000000, 0, 5 },
{ 5, 8000000, 0, 5 },
@@ -339,7 +348,7 @@ TEST_F(SeekableBufferTest, GetTime) {
EXPECT_EQ(tests[i].expected_time, actual) << "With test = { start:"
<< tests[i].first_time_useconds << ", duration:"
<< tests[i].duration_useconds << ", consumed:"
- << tests[i].consume_bytes << "}\n";
+ << tests[i].consume_bytes << " }\n";
buffer_.Clear();
}
« no previous file with comments | « media/base/seekable_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698