Bug 1788557 - Remove SeekHead element from test.webm to make it a valid ebml document. r=alwu
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 15 Sep 2022 22:17:26 +0000
changeset 635685 5a2d07ad3a1869f22256d8bb93aa795377394fcd
parent 635684 6af5e9e9d203176a73a1f75f799fc82d9628cb55
child 635686 f96bfbe8664a829c68a3da78504aafab2768b7bb
push id169902
push userpehrsons@gmail.com
push dateThu, 15 Sep 2022 22:27:59 +0000
treeherderautoland@5b0c144fe507 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalwu
bugs1788557
milestone106.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1788557 - Remove SeekHead element from test.webm to make it a valid ebml document. r=alwu Differential Revision: https://phabricator.services.mozilla.com/D156676
dom/media/gtest/TestWebMBuffered.cpp
dom/media/gtest/test.webm
--- a/dom/media/gtest/TestWebMBuffered.cpp
+++ b/dom/media/gtest/TestWebMBuffered.cpp
@@ -12,30 +12,30 @@ using namespace mozilla;
 
 // "test.webm" contains 8 SimpleBlocks in a single Cluster.  The blocks with
 // timecodes 100000000 and are 133000000 skipped by WebMBufferedParser
 // because they occur after a block with timecode 160000000 and the parser
 // expects in-order timecodes per the WebM spec.  The remaining 6
 // SimpleBlocks have the following attributes:
 static const uint64_t gTimecodes[] = {66000000,  160000000, 166000000,
                                       200000000, 233000000, 320000000};
-static const int64_t gEndOffsets[] = {501, 772, 1244, 1380, 1543, 2015};
+static const int64_t gEndOffsets[] = {466, 737, 1209, 1345, 1508, 1980};
 
 TEST(WebMBuffered, BasicTests)
 {
   WebMBufferedParser parser(0);
 
   nsTArray<WebMTimeDataOffset> mapping;
-  parser.Append(nullptr, 0, mapping);
+  EXPECT_TRUE(parser.Append(nullptr, 0, mapping));
   EXPECT_TRUE(mapping.IsEmpty());
   EXPECT_EQ(parser.mStartOffset, 0);
   EXPECT_EQ(parser.mCurrentOffset, 0);
 
   unsigned char buf[] = {0x1a, 0x45, 0xdf, 0xa3};
-  parser.Append(buf, ArrayLength(buf), mapping);
+  EXPECT_TRUE(parser.Append(buf, ArrayLength(buf), mapping));
   EXPECT_TRUE(mapping.IsEmpty());
   EXPECT_EQ(parser.mStartOffset, 0);
   EXPECT_EQ(parser.mCurrentOffset, 4);
 }
 
 static void ReadFile(const char* aPath, nsTArray<uint8_t>& aBuffer) {
   FILE* f = fopen(aPath, "rb");
   ASSERT_NE(f, (FILE*)nullptr);
@@ -60,56 +60,56 @@ static void ReadFile(const char* aPath, 
 TEST(WebMBuffered, RealData)
 {
   WebMBufferedParser parser(0);
 
   nsTArray<uint8_t> webmData;
   ReadFile("test.webm", webmData);
 
   nsTArray<WebMTimeDataOffset> mapping;
-  parser.Append(webmData.Elements(), webmData.Length(), mapping);
+  EXPECT_TRUE(parser.Append(webmData.Elements(), webmData.Length(), mapping));
   EXPECT_EQ(mapping.Length(), 6u);
   EXPECT_EQ(parser.mStartOffset, 0);
   EXPECT_EQ(parser.mCurrentOffset, int64_t(webmData.Length()));
   EXPECT_EQ(parser.GetTimecodeScale(), 500000u);
 
   for (uint32_t i = 0; i < mapping.Length(); ++i) {
     EXPECT_EQ(mapping[i].mEndOffset, gEndOffsets[i]);
-    EXPECT_EQ(mapping[i].mSyncOffset, 361);
+    EXPECT_EQ(mapping[i].mSyncOffset, 326);
     EXPECT_EQ(mapping[i].mTimecode, gTimecodes[i]);
   }
 }
 
 TEST(WebMBuffered, RealDataAppend)
 {
   WebMBufferedParser parser(0);
   nsTArray<WebMTimeDataOffset> mapping;
 
   nsTArray<uint8_t> webmData;
   ReadFile("test.webm", webmData);
 
   uint32_t arrayEntries = mapping.Length();
   size_t offset = 0;
   while (offset < webmData.Length()) {
-    parser.Append(webmData.Elements() + offset, 1, mapping);
+    EXPECT_TRUE(parser.Append(webmData.Elements() + offset, 1, mapping));
     offset += 1;
     EXPECT_EQ(parser.mCurrentOffset, int64_t(offset));
     if (mapping.Length() != arrayEntries) {
       arrayEntries = mapping.Length();
       ASSERT_LE(arrayEntries, 6u);
       uint32_t i = arrayEntries - 1;
       EXPECT_EQ(mapping[i].mEndOffset, gEndOffsets[i]);
-      EXPECT_EQ(mapping[i].mSyncOffset, 361);
+      EXPECT_EQ(mapping[i].mSyncOffset, 326);
       EXPECT_EQ(mapping[i].mTimecode, gTimecodes[i]);
       EXPECT_EQ(parser.GetTimecodeScale(), 500000u);
     }
   }
   EXPECT_EQ(mapping.Length(), 6u);
   EXPECT_EQ(parser.mStartOffset, 0);
   EXPECT_EQ(parser.mCurrentOffset, int64_t(webmData.Length()));
   EXPECT_EQ(parser.GetTimecodeScale(), 500000u);
 
   for (uint32_t i = 0; i < mapping.Length(); ++i) {
     EXPECT_EQ(mapping[i].mEndOffset, gEndOffsets[i]);
-    EXPECT_EQ(mapping[i].mSyncOffset, 361);
+    EXPECT_EQ(mapping[i].mSyncOffset, 326);
     EXPECT_EQ(mapping[i].mTimecode, gTimecodes[i]);
   }
 }
index 487914c4a3d2fb22f096c07ece1e9a3d071aed73..fc9e9912702fc5a7ead9b5e80e54bc042d3613ff
GIT binary patch
literal 1980
zc$@*e2SfN8Mc<>JLWY3>Lid3ILh^wGLi2$LLV|>MWnyhYhk*n_g@FPXQ-Egy00000
z0x5eHNvUQ)h$`2yg9o7?O@O0pX<}t!ZEPTRF)lMMFd!=+Y-wU`VRUkDb8BHBb}=qA
zE-_a@#%*hMZDn$2WgvDpE-)@IASfqSXk~I`AXjA|M{j9vXD2BjHZ)>sbRc4NX>4>L
zZ*Cw;b#5RrI3O}GF*G1DGCDOmIx{mwiG)UY@Bl<%hz0|4@<X9q02WlPYe0gou-AbB
zbH#*n6D9J4fdOsjfdPhvR$o?7IpCJCf&pl{f&ze4u!H~r0ccdZga7~nfUeHhfdX^I
zh#NyUzAiI$w}XKKhK503Pf%4;R=b1*#IyioqLWW>b#q8%VPpXUI01mW0000003x-V
zgLQ6XR;q(zE}-FwwS-4IfB>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