function expectMediaInfo(expectedUri, expectedDuration, metadata=null) {
    expect(mockGenericMessageBus.messages.length).toBeGreaterThan(0);
    if (mockGenericMessageBus.messages.length == 0) {
      return;
    }

    const expectedMedia = {
      contentId: expectedUri,
      streamType: 'BUFFERED',
      duration: expectedDuration,
      contentType: '',
    };

    if (metadata) {
      // This field only sometimes shows up.
      // Setting it to null would cause the check below to fail.
      expectedMedia.metadata = metadata;
    }

    expect(mockGenericMessageBus.messages[0]).toEqual({
      requestId: 0,
      type: 'MEDIA_STATUS',
      status: [jasmine.objectContaining({
        media: expectedMedia,
      })],
    });
    mockGenericMessageBus.messages.shift();
  }
@param {string} expectedUri
@param {number} expectedDuration
@param {Object=} metadata