Bug 1330918 - Set timestamp in VP8TrackEncoder GTest. r?jesup draft
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 19 Jan 2017 10:51:52 +0100
changeset 463600 3c58ef060a38badab9b17411a13675e45a8d9e1c
parent 463599 4223a48bf1497fbd9ef8679fc475ec549b4a86ca
child 464145 261bbd3650395ccb6c728f22a8a703a3544a7875
push id42131
push userbmo:pehrson@telenordigital.com
push dateThu, 19 Jan 2017 14:19:52 +0000
reviewersjesup
bugs1330918
milestone53.0a1
Bug 1330918 - Set timestamp in VP8TrackEncoder GTest. r?jesup MozReview-Commit-ID: 4LeR1iUZBgs
dom/media/gtest/TestVideoTrackEncoder.cpp
--- a/dom/media/gtest/TestVideoTrackEncoder.cpp
+++ b/dom/media/gtest/TestVideoTrackEncoder.cpp
@@ -260,23 +260,26 @@ TEST(VP8VideoTrackEncoder, FrameEncode)
   nsTArray<RefPtr<Image>> images;
   YUVBufferGenerator generator;
   generator.Init(mozilla::gfx::IntSize(640, 480));
   generator.Generate(images);
 
   // Put generated YUV frame into video segment.
   // Duration of each frame is 1 second.
   VideoSegment segment;
+  TimeStamp now = TimeStamp::Now();
   for (nsTArray<RefPtr<Image>>::size_type i = 0; i < images.Length(); i++)
   {
     RefPtr<Image> image = images[i];
     segment.AppendFrame(image.forget(),
                         mozilla::StreamTime(90000),
                         generator.GetSize(),
-                        PRINCIPAL_HANDLE_NONE);
+                        PRINCIPAL_HANDLE_NONE,
+                        false,
+                        now + TimeDuration::FromSeconds(i));
   }
 
   // track change notification.
   encoder.SetCurrentFrames(segment);
 
   // Pull Encoded Data back from encoder.
   EncodedFrameContainer container;
   EXPECT_TRUE(NS_SUCCEEDED(encoder.GetEncodedTrack(container)));