function assertAsyncDecoratorCommandSequenceCalls(
    decorator, expectedCommandSequenceCalls) {
  const interval = 500;

  const mockClock = new MockClock(true);
  for (let commandSequence in expectedCommandSequenceCalls) {
    const recordedFunction = recordFunction();
    /** @suppress {checkTypes} suppression added to enable type checking */
    const f = decorator(recordedFunction, interval);

    for (let i = 0; i < commandSequence.length; ++i) {
      switch (commandSequence[i]) {
        case 'f':
          f();
          break;
        case 'w':
          mockClock.tick(interval);
          break;
      }
    }

    const expectedCalls = expectedCommandSequenceCalls[commandSequence];
    assertEquals(
        `Expected ${expectedCalls} calls for command sequence "` +
            commandSequence + '" (' +
            Array.prototype.map
                .call(
                    commandSequence,
                    command => {
                      switch (command) {
                        case 'f':
                          return 'fire';
                        case 'w':
                          return 'wait';
                      }
                    })
                .join(' -> ') +
            ')',
        expectedCalls, recordedFunction.getCallCount());
  }
  mockClock.uninstall();
}
Wraps a `recordFunction` with the specified decorator and
executes a list of command sequences, asserting that in each case the
decorated function is called the expected number of times.
@param {function():*} decorator The async decorator to test.
@param {!Object<string,number>} expectedCommandSequenceCalls An object
    mapping string command sequences (where 'f' is 'fire' and 'w' is 'wait')
    to the number times we expect a decorated function to be called during
    the execution of those commands.
@suppress {checkTypes} suppression added to enable type checking