   img.addEventListener("load", _ => {
      asyncTest.step(test);
      asyncTest.done();
    });
  };

  let testElements = document.querySelectorAll(".target");

  for (let i=0; i<testElements.length; ++i) {
    let myTest = makeTest(testElements[i]);
    if (testElements[i].nodeName == "IMG" && !testElements[i].complete) {
      testAfterImageLoads(testElements[i], myTest);
    } else {
      test(myTest, getTestName(testElements[i]));
    }
  }
</script>
