testExecOnLoadError() {
    // Expect two callbacks, each of which will be called with callback type
    // ERROR, the right module id and failure type INIT_ERROR.
    const errorCallback1 = testing.createFunctionMock('callback1');
    errorCallback1(
        ModuleManager.CallbackType.ERROR, 'b',
        new ModuleLoadFailure(ModuleLoadFailure.Type.INIT_ERROR));

    const errorCallback2 = testing.createFunctionMock('callback2');
    errorCallback2(
        ModuleManager.CallbackType.ERROR, 'b',
        new ModuleLoadFailure(ModuleLoadFailure.Type.INIT_ERROR));

    errorCallback1.$replay();
    errorCallback2.$replay();

    const mm = new ModuleManager();
    mm.setLoader(createSuccessfulNonBatchLoader(mm));

    // Register the first callback before setting the module info map.
    mm.registerCallback(ModuleManager.CallbackType.ERROR, errorCallback1);

    mm.setAllModuleInfo({'a': [], 'b': [], 'c': []});

    // Register the second callback after setting the module info map.
    mm.registerCallback(ModuleManager.CallbackType.ERROR, errorCallback2);

    let execOnLoadBCalled = false;
    mm.execOnLoad('b', () => {
      execOnLoadBCalled = true;
      throw new Error();
    });

    assertThrows(() => {
      clock.tick(5);
    });

    assertTrue(
        'execOnLoad should have been called on module b.', execOnLoadBCalled);
    errorCallback1.$verify();
    errorCallback2.$verify();
  }
Tests that an error during execOnLoad will trigger the error callback.
@suppress {checkTypes} suppression added to enable type checking