summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/support/relevant-mutations.js
blob: 7105b037084be829e6319ab730ed10b034c544cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
setup({explicit_done:true});

function t(desc, func, expect) {
  async_test(function() {
    var img = document.querySelector('[data-desc="' + desc + '"]');
    img.onload = img.onerror = this.unreached_func('update the image data was run');
    if (expect == 'timeout') {
      setTimeout(this.step_func_done(), 1000);
    } else {
      img['on' + expect] = this.step_func_done();
      setTimeout(this.unreached_func('update the image data didn\'t run'), 1000);
    }
    func.call(this, img);
  }, desc);
}