Revision ae13e0657812995fed82c383c820036aeb03108a authored by Stephen McGruer on 13 March 2018, 01:33:01 UTC, committed by Blink WPT Bot on 13 March 2018, 01:41:53 UTC
The spec says that setting the current time to null should throw if the
existing currentTime is non-null, or do nothing otherwise.

Bug: 818196
Change-Id: Iac89e46d6b884c924c88b603fbec77b61a337ce2
Reviewed-on: https://chromium-review.googlesource.com/946050
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542682}
1 parent 28300a0
Raw File
timeout-sync.htm
<!doctype html>
<html>
  <head>
    <title>XMLHttpRequest: timeout not allowed for sync requests</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <link rel="help" href="https://xhr.spec.whatwg.org/#the-timeout-attribute" data-tested-assertations="following::ol/li[1]" />
    <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol/li[10]" />
  </head>
  <body>
    <div id="log"></div>
    <script>
      test(function() {
        var client = new XMLHttpRequest()
        client.open('GET', 'folder.txt', false)
        assert_throws("InvalidAccessError", function() { client.timeout = 1000 })
        }, 'setting timeout attribute on sync request')
      test(function() {
        var client = new XMLHttpRequest()
        client.timeout = 1000
        assert_throws("InvalidAccessError", function() { client.open('GET', 'folder.txt', false) })
        }, 'open() with async false when timeout is set')
    </script>
  </body>
</html>
back to top