run(e, url) {
    if (this.expectationType === FetchLaterExpectationType.DONE) {
      if (e.data.type === FetchLaterIframeMessageType.DONE) {
        return true;
      }
      if (e.data.type === FetchLaterIframeMessageType.ERROR &&
          e.data.error !== undefined) {
        throw new FetchLaterExpectationError(
            url, e.data.error.name, 'no error');
      }
    }

    if (this.expectationType === FetchLaterExpectationType.ERROR_JS) {
      if (e.data.type === FetchLaterIframeMessageType.DONE) {
        throw new FetchLaterExpectationError(
            url, 'nothing', this.expectedErrorType.name);
      }
      if (e.data.type === FetchLaterIframeMessageType.ERROR) {
        if (e.data.error.constructor === this.expectedErrorType &&
            e.data.error.name === this.expectedErrorType.name) {
          return true;
        }
        throw new FetchLaterExpectationError(
            url, e.data.error, this.expectedErrorType.name);
      }
    }

    if (this.expectationType === FetchLaterExpectationType.ERROR_DOM) {
      if (e.data.type === FetchLaterIframeMessageType.DONE) {
        throw new FetchLaterExpectationError(
            url, 'nothing', this.expectedDomErrorName);
      }
      if (e.data.type === FetchLaterIframeMessageType.ERROR) {
        const actual = e.data.error.name || e.data.error.type;
        if (e.data.error.constructor.name === 'DOMException' &&
            actual == this.expectedDomErrorName) {
          return true;
        }
        throw new FetchLaterExpectationError(
            url, actual, this.expectedDomErrorName);
      }
    }

    return false;
  }
Verifies the message from `e` against the configured expectation.

@param {MessageEvent} e
@param {string} url The source URL of the iframe where `e` is dispatched
from.
@return {bool}
- Returns true if the expected message event is passed into the function
  and the expectation is fulfilled. The caller should be able to safely
  remove the message event listener afterwards.
- Returns false if the passed in event is not of the expected type. The
  caller should continue waiting for another message event and call this
  function again.
@throws {Error} Throws an error if the expected message event is passed but
  the expectation fails. The caller should remove the message event
  listener and perform test failure handling.