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 <stdint.h> |
| 6 |
5 #include "media/ffmpeg/ffmpeg_common.h" | 7 #include "media/ffmpeg/ffmpeg_common.h" |
6 #include "media/filters/in_memory_url_protocol.h" | 8 #include "media/filters/in_memory_url_protocol.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
8 | 10 |
9 namespace media { | 11 namespace media { |
10 | 12 |
11 static const uint8_t kData[] = {0x01, 0x02, 0x03, 0x04}; | 13 static const uint8_t kData[] = {0x01, 0x02, 0x03, 0x04}; |
12 | 14 |
13 TEST(InMemoryUrlProtocolTest, ReadFromLargeBuffer) { | 15 TEST(InMemoryUrlProtocolTest, ReadFromLargeBuffer) { |
14 InMemoryUrlProtocol protocol(kData, std::numeric_limits<int64_t>::max(), | 16 InMemoryUrlProtocol protocol(kData, std::numeric_limits<int64_t>::max(), |
(...skipping 28 matching lines...) Expand all Loading... |
43 EXPECT_TRUE(protocol.SetPosition(sizeof(kData))); | 45 EXPECT_TRUE(protocol.SetPosition(sizeof(kData))); |
44 EXPECT_EQ(0, protocol.Read(1, &out)); | 46 EXPECT_EQ(0, protocol.Read(1, &out)); |
45 | 47 |
46 int i = sizeof(kData) / 2; | 48 int i = sizeof(kData) / 2; |
47 EXPECT_TRUE(protocol.SetPosition(i)); | 49 EXPECT_TRUE(protocol.SetPosition(i)); |
48 EXPECT_EQ(1, protocol.Read(1, &out)); | 50 EXPECT_EQ(1, protocol.Read(1, &out)); |
49 EXPECT_EQ(kData[i], out); | 51 EXPECT_EQ(kData[i], out); |
50 } | 52 } |
51 | 53 |
52 } // namespace media | 54 } // namespace media |
OLD | NEW |