testPreloadDeferredWhenLoading() {
    const mm = getModuleManager({'a': []});
    mm.setLoader(createSuccessfulNonBatchLoader(mm));

    mm.preloadModule('a');
    clock.tick(1);

    // 'b' is in the middle of loading, should get called back when it's
    // done.
    let calledBack = false;
    const d = mm.preloadModule('a');
    d.addCallback((ctx) => {
      calledBack = true;
    });

    assertFalse('module "a" should not be loaded yet', calledBack);
    clock.tick(4);
    assertTrue('module "a" should be loaded', calledBack);
  }
Tests preloading a module that is currently loading.