async function makeTimelineSegmentIndex(info, delayPeriodEnd = true,
      shouldFit = false) {
    const isTimeline = info.timeline.length > 0;
    // Period end may be a bit after the last timeline entry
    let periodEnd = isTimeline ?
      info.timeline[info.timeline.length - 1].end : 0;
    if (delayPeriodEnd) {
      periodEnd += 1.0;
    }

    const dummySource = Dash.makeSimpleManifestText([
      '<SegmentTemplate startNumber="0" duration="10"',
      '    media="$Number$-$Time$-$Bandwidth$.mp4">',
      '  <SegmentTimeline>',
      isTimeline ? '    <S t="0" d="15" r="2" />' : '',
      '  </SegmentTimeline>',
      '</SegmentTemplate>',
    ], /* duration= */ 45);

    fakeNetEngine.setResponseText('dummy://foo', dummySource);
    const manifest = await parser.start('dummy://foo', playerInterface);

    expect(manifest.variants.length).toBe(1);

    const stream = manifest.variants[0].video;
    expect(stream).toBeTruthy();
    await stream.createSegmentIndex();

    /** @type {?} */
    const index = stream.segmentIndex;
    index.release();
    index.appendTemplateInfo(info, isTimeline ? info.timeline[0].start : 0,
        periodEnd, shouldFit);

    return index;
  }
@param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
@param {boolean} delayPeriodEnd
@param {boolean} shouldFit
@return {?}