summaryrefslogtreecommitdiffstats
path: root/dom/bindings/parser/tests/test_argument_keywords.py
blob: bbed33df92625c9eaba3ee1cd1c05b70e1558a71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
def WebIDLTest(parser, harness):
    parser.parse(
        """
    interface Foo {
      undefined foo(object constructor);
    };
    """
    )

    results = parser.finish()
    harness.check(len(results), 1, "Should have an interface")
    iface = results[0]
    harness.check(len(iface.members), 1, "Should have an operation")
    operation = iface.members[0]
    harness.check(len(operation.signatures()), 1, "Should have one signature")
    (retval, args) = operation.signatures()[0]
    harness.check(len(args), 1, "Should have an argument")
    harness.check(
        args[0].identifier.name,
        "constructor",
        "Should have an identifier named 'constructor'",
    )