Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/xhr/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  open-after-abort.htm

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/xhr/open-after-abort.htm


<!doctype html>
<html>
  <head>
    <title>XMLHttpRequest: open() after abort()</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol/li[15] following::ol/li[15]/ol/li[1] following::ol/li[15]/ol/li[2]" />
  </head>
  <body>
    <div id="log"></div>
    <script>
      test(function(t) {
        var client = new XMLHttpRequest(),
            result = [],
            expected = [
              'readystatechange'01,  // open()
              'readystatechange'24,  // abort()
              'abort',            24,  // abort()
              'loadend',          24,  // abort()
              'readystatechange'31,  // open()
            ]

        var state = 0

        client.onreadystatechange = t.step_func(function() {
          result.push('readystatechange', state, client.readyState)
        })
        client.onabort = t.step_func(function() {
          // abort event must be fired synchronously from abort().
          assert_equals(state, 2)

          // readystatechange should be fired before abort.
          assert_array_equals(result, [
            'readystatechange'01,  // open()
            'readystatechange'24,  // abort()
          ])

          // readyState should be set to unsent (0) at the very end of abort(),
          // after this (and onloadend) is called.
          assert_equals(client.readyState, 4)

          result.push('abort', state, client.readyState)
        })
        client.onloadend = t.step_func(function() {
          // abort event must be fired synchronously from abort().
          assert_equals(state, 2)

          // readystatechange should be fired before abort.
          assert_array_equals(result, [
            'readystatechange'01,  // open()
            'readystatechange'24,  // abort()
            'abort',            24,  // abort()
          ])

          // readyState should be set to unsent (0) at the very end of abort(),
          // after this is called.
          assert_equals(client.readyState, 4)

          result.push('loadend', state, client.readyState)
        })

        client.open("GET""resources/well-formed.xml")
        assert_equals(client.readyState, 1)

        state = 1
        client.send(null)
        state = 2
        client.abort()
        assert_equals(client.readyState, 0)
        state = 3
        client.open("GET""resources/well-formed.xml")
        assert_equals(client.readyState, 1)
        assert_array_equals(result, expected)
      })
    </script>
  </body>
</html>

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet am  2026-06-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.