Index: media/base/video_frame_unittest.cc |
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc |
index 618d68f458f774de68fc2792e3e6693247308eae..236f52dd9ff926a81adbfd43d46d38089e6def19 100644 |
--- a/media/base/video_frame_unittest.cc |
+++ b/media/base/video_frame_unittest.cc |
@@ -240,17 +240,24 @@ TEST(VideoFrame, CheckFrameExtents) { |
ExpectFrameExtents(VideoFrame::YV16, "cce408a044b212db42a10dfec304b3ef"); |
} |
-static void TextureCallback(std::vector<uint32>* called_sync_point, |
- const std::vector<uint32>& release_sync_points) { |
- called_sync_point->assign(release_sync_points.begin(), |
- release_sync_points.end()); |
+static void TextureCallback( |
+ std::map<std::string, uint32>* called_sync_point, |
+ const std::map<std::string, uint32>& release_sync_points) { |
+ called_sync_point->clear(); |
+ for (std::map<std::string, uint32>::const_iterator iter = |
+ release_sync_points.begin(); |
+ iter != release_sync_points.end(); |
+ iter++) { |
+ EXPECT_TRUE(called_sync_point->insert(std::make_pair(iter->first, |
+ iter->second)).second); |
+ } |
} |
// Verify the gpu::MailboxHolder::ReleaseCallback is called when VideoFrame is |
// destroyed with the default release sync points. |
TEST(VideoFrame, TextureNoLongerNeededCallbackIsCalled) { |
- std::vector<uint32> called_sync_points; |
- called_sync_points.push_back(1); |
+ std::map<std::string, uint32> called_sync_points; |
+ called_sync_points["test1"] = 1; |
{ |
scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture( |
@@ -272,16 +279,16 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackIsCalled) { |
// destroyed with the release sync points, which was updated by clients. |
// (i.e. the compositor, webgl). |
TEST(VideoFrame, TextureNoLongerNeededCallbackAfterTakingAndReleasingMailbox) { |
- std::vector<uint32> called_sync_points; |
+ std::map<std::string, uint32> called_sync_points; |
gpu::Mailbox mailbox; |
mailbox.name[0] = 50; |
uint32 sync_point = 7; |
uint32 target = 9; |
- std::vector<uint32> release_sync_points; |
- release_sync_points.push_back(1); |
- release_sync_points.push_back(2); |
- release_sync_points.push_back(3); |
+ std::map<std::string, uint32> release_sync_points; |
+ release_sync_points["test1"] = 1; |
+ release_sync_points["test2"] = 2; |
+ release_sync_points["test3"] = 3; |
{ |
scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture( |
@@ -300,9 +307,16 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackAfterTakingAndReleasingMailbox) { |
EXPECT_EQ(target, mailbox_holder->texture_target); |
EXPECT_EQ(sync_point, mailbox_holder->sync_point); |
- frame->AppendReleaseSyncPoint(release_sync_points[0]); |
- frame->AppendReleaseSyncPoint(release_sync_points[1]); |
- frame->AppendReleaseSyncPoint(release_sync_points[2]); |
+ frame->AppendReleaseSyncPoint("test1", 100); |
+ frame->AppendReleaseSyncPoint("test2", 101); |
+ frame->AppendReleaseSyncPoint("test3", 102); |
+ // Above sync points are overridden. |
+ for (std::map<std::string, uint32>::const_iterator iter = |
+ release_sync_points.begin(); |
+ iter != release_sync_points.end(); |
+ iter++) { |
+ frame->AppendReleaseSyncPoint(iter->first, iter->second); |
+ } |
EXPECT_EQ(sync_point, mailbox_holder->sync_point); |
} |
EXPECT_EQ(release_sync_points, called_sync_points); |