testImageLoaderClientEventDispatchOrder() {
    const clientLoader = new ImageLoader();
    makeLoaderSynchronous(clientLoader);

    // Creates a testing client that will dispose of the image loader on the
    // final propagated LOAD event.
    const testingClientImageLoader = new TestingClientImageLoader(clientLoader);

    let i = 0;
    for (const key in TEST_IMAGES) {
      const imageId = 'img_' + i++;
      testingClientImageLoader.addImage(imageId, key);
    }

    // Add more images once the first images finishes loading, and call start()
    // to get them going.
    events.listenOnce(testingClientImageLoader, EventType.LOAD, (e) => {
      testingClientImageLoader.addImage('extra_image', 'extra_image.gif');
      testingClientImageLoader.addImage('extra_image2', 'extra_image2.gif');
      testingClientImageLoader.start();
    });

    // Start testing.
    testingClientImageLoader.start();

    assertEquals(
        'All images should have dispatched a LOAD call before disposing.',
        googObject.getCount(TEST_IMAGES), testingClientImageLoader.loadCount);
    assertEquals(
        'COMPLETE should never be dispatched if we dispose the instance on image removal.',
        0, testingClientImageLoader.completeCount);
    assertEquals(
        'There should be no references to images in the image loader at time of dispose.',
        testingClientImageLoader.imageLoaderRemainingSize, 0);
  }
Verifies order of event dispatch when events are handled by a client of
{@link goog.net.ImageLoader}.