summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/xhr-timeout-longtask.any.js
blob: 161713104aefcf8a195e9c7c120bfcddb3f89b92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
async_test(function() {
  var client = new XMLHttpRequest();
  client.open("GET", "resources/delay.py?ms=100", true);

  client.timeout = 150;
  client.ontimeout = this.step_func(assert_unreached);
  client.onloadend = () => this.done();

  client.send();

  const start = performance.now();
  while (performance.now() - start < 200) { }
}, "Long tasks should not trigger load timeout")