summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/headers/headers-idl.html
blob: 2aaa1ceeaee25f8a9ebe3622239869f7eac32fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Headers idl interface</title>
    <meta name="help" href="https://fetch.spec.whatwg.org/#response">
    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/resources/WebIDLParser.js"></script>
    <script src="/resources/idlharness.js"></script>
  </head>
  <body>
    <script id="headers-idl" type="text/plain">
      typedef (Headers or sequence<sequence<ByteString>> or OpenEndedDictionary<ByteString>) HeadersInit;

      [Constructor(optional HeadersInit init),
      Exposed=(Window,Worker)]
      interface Headers {
        void append(ByteString name, ByteString value);
        void delete(ByteString name);
        ByteString? get(ByteString name);
        boolean has(ByteString name);
        void set(ByteString name, ByteString value);
        iterable<ByteString, ByteString>;
      };
    </script>
    <script>
      var idlsArray = new IdlArray();
      var idl = document.getElementById("headers-idl").innerHTML
      idlsArray.add_idls(idl);
      idlsArray.add_objects({ Headers: ['new Headers()'] });
      idlsArray.test();
    </script>
  </body>
</html>