tests/integration/scenarios/dash_stream-events.js
/**
   * Expect that no "streamEvent" nor "streamEventSkip" events are received when
   * loading a content at the given position and playing for around 3 seconds.
   * @param {Object} opts
   * @returns {Promise}
   */
Expect that no "streamEvent" nor "streamEventSkip" events are received when
loading a content at the given position and playing for around 3 seconds.
@param {Object} opts
@returns {Promise}
Expect that no " streamEvent " nor " streamEventSkip " events are received when loading a content at the given position and playing for around 3 seconds . @param { Object } opts @returns { Promise }
async function expectNoEvent({ startAt }) {
    const streamEventsReceived = [];
    const streamEventSkipReceived = [];
    function onStreamEvent(evt) {
      streamEventsReceived.push(evt);
    }
    function onStreamEventSkip(evt) {
      streamEventSkipReceived.push(evt);
    }
    player.addEventListener("streamEvent", onStreamEvent);
    player.addEventListener("streamEventSkip", onStreamEventSkip);
    await loadContent(startAt);
    player.play();
    await sleep(3000);
    player.pause();
    expect(player.getPosition()).to.be
      .within(startAt + 1, startAt + 5, "The initial position is not right");
    expect(streamEventsReceived).to.have
      .lengthOf(0, "We should not have received any streamEvent event");
    expect(streamEventSkipReceived).to.have
      .lengthOf(0, "We should not have received any streamEventSkipReceived event");
  }
async function expectNoEvent ( { startAt } ) { const streamEventsReceived = [ ] ; const streamEventSkipReceived = [ ] ; function onStreamEvent ( evt ) { streamEventsReceived . push ( evt ) ; } function onStreamEventSkip ( evt ) { streamEventSkipReceived . push ( evt ) ; } player . addEventListener ( "streamEvent" , onStreamEvent ) ; player . addEventListener ( "streamEventSkip" , onStreamEventSkip ) ; await loadContent ( startAt ) ; player . play ( ) ; await sleep ( 3000 ) ; player . pause ( ) ; expect ( player . getPosition ( ) ) . to . be . within ( startAt + 1 , startAt + 5 , "The initial position is not right" ) ; expect ( streamEventsReceived ) . to . have . lengthOf ( 0 , "We should not have received any streamEvent event" ) ; expect ( streamEventSkipReceived ) . to . have . lengthOf ( 0 , "We should not have received any streamEventSkipReceived event" ) ; }
Expect that no "streamEvent" nor "streamEventSkip" events are received when
 loading a content at the given position and playing for around 3 seconds.
Expect that no " streamEvent " nor " streamEventSkip " events are received when loading a content at the given position and playing for around 3 seconds .