gnElement);
  t.add_cleanup(() => {
    foreignElement.remove();
  });

  const animation = foreignElement.animate(null, 100 * MS_PER_SEC);
  assert_array_equals(foreignElement.getAnimations(), [animation]);
}, 'Returns animations for a foreign element');

test(t => {
  const div = createDiv(t);
  const animation = div.animate(null, 100 * MS_PER_SEC);
  animation.finish();
  assert_array_equals(div.getAnimations(), []);
}, 'Does not return finished animations that do not fill forwards');

test(t => {
  cons