https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 165b38a337777a07db471dacd5c9dc35ee07a5d3 authored by Ovidio Henriquez on 30 March 2018, 22:26:25 UTC
Reland "bluetooth: FakeBluetoothChooser impl."
Tip revision: 165b38a
access-control-basic-allow-non-cors-safelisted-method-async.htm
<!DOCTYPE html>
<html>
  <head>
    <title>Tests cross-origin async request with non-CORS-safelisted method</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/common/get-host-info.sub.js"></script>
  </head>
  <body>
    <script type="text/javascript">
    async_test((test) => {
      const xhr = new XMLHttpRequest;

      xhr.onload = test.step_func_done(() => {
        assert_equals(xhr.responseText, "PASS: Cross-domain access allowed.\nPASS: PUT data received");
      });

      xhr.onerror = test.unreached_func("Unexpected error.");

      xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN +
          "/xhr/resources/access-control-basic-put-allow.py");
      xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8");
      xhr.send("PASS: PUT data received");
    }, "Allow async PUT request");
    </script>
  </body>
</html>
back to top