testLoadMultipleWithFailingModule() {
    const mm = getModuleManager({'a': [], 'b': [], 'c': []});
    mm.setLoader(createUnsuccessfulLoader(mm, 401));
    mm.setBatchModeEnabled(true);
    mm.registerCallback(
        ModuleManager.CallbackType.ERROR, (callbackType, id, cause) => {
          assertEquals(
              'Failure cause was not as expected',
              ModuleLoadFailure.Type.UNAUTHORIZED, cause.type);
        });
    let calledBack11 = false;
    let error11 = null;
    let calledBack12 = false;
    let error12 = null;
    let calledBack21 = false;
    let error21 = null;
    let calledBack22 = false;
    let error22 = null;

    const dMap = mm.loadMultiple(['a', 'b']);
    dMap['a'].then(
        (ctx) => {
          calledBack11 = true;
        },
        (err) => {
          error11 = err;
        });
    dMap['b'].then(
        (ctx) => {
          calledBack12 = true;
        },
        (err) => {
          error12 = err;
        });

    const dMap2 = mm.loadMultiple(['b', 'c']);
    dMap2['b'].then(
        (ctx) => {
          calledBack21 = true;
        },
        (err) => {
          error21 = err;
        });
    dMap2['c'].then(
        (ctx) => {
          calledBack22 = true;
        },
        (err) => {
          error22 = err;
        });

    assertFalse(calledBack11);
    assertFalse(calledBack12);
    assertFalse(calledBack21);
    assertFalse(calledBack22);
    assertNull(error11);
    assertNull(error12);
    assertNull(error21);
    assertNull(error22);

    clock.tick(5);

    assertFalse(calledBack11);
    assertFalse(calledBack12);
    assertFalse(calledBack21);
    assertFalse(calledBack22);

    // NOTE: Deferred always calls errbacks with an Error object.  The
    // failure type enum is present as error.failureType, while the error
    // message is human readable and contains the module id.
    assertEquals(
        'Failure cause was not as expected',
        ModuleLoadFailure.Type.UNAUTHORIZED, error11.failureType.type);
    assertEquals(
        'Error message was not as expected',
        'Error loading a: Unauthorized (401)', error11.message);
    assertEquals(
        'Failure cause was not as expected',
        ModuleLoadFailure.Type.UNAUTHORIZED, error12.failureType.type);
    assertEquals(
        'Error message was not as expected',
        'Error loading b: Unauthorized (401)', error12.message);

    // The first deferred of the second load should be called since it asks
    // for one of the failed modules.
    assertEquals(
        'Failure cause was not as expected',
        ModuleLoadFailure.Type.UNAUTHORIZED, Number(error21.failureType.type));
    assertEquals(
        'Error message was not as expected',
        'Error loading b: Unauthorized (401)', error21.message);

    // The last deferred should be dropped so it is neither called back nor
    // an error.
    assertFalse(calledBack22);
    assertNull(error22);
  }
Tests that the deferred's errbacks are called if a module fails to
     load.