dom/bindings/parser/tests/test_union_nullable.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 def WebIDLTest(parser, harness):
     2     threw = False
     3     try:
     4         parser.parse("""
     5             interface OneNullableInUnion {
     6               void foo((object? or DOMString?) arg);
     7             };
     8         """)
    10         results = parser.finish()
    11     except:
    12         threw = True
    14     harness.ok(threw,
    15                "Two nullable member types of a union should have thrown.")
    17     parser.reset()
    18     threw = False
    20     try:
    21         parser.parse("""
    22             interface NullableInNullableUnion {
    23               void foo((object? or DOMString)? arg);
    24             };
    25         """)
    27         results = parser.finish()
    28     except:
    29         threw = True
    31     harness.ok(threw,
    32                "A nullable union type with a nullable member type should have "
    33                "thrown.")
    35     parser.reset()
    36     threw = False
    38     try:
    39         parser.parse("""
    40             interface NullableInUnionNullableUnionHelper {
    41             };
    42             interface NullableInUnionNullableUnion {
    43               void foo(((object? or DOMString) or NullableInUnionNullableUnionHelper)? arg);
    44             };
    45         """)
    47         results = parser.finish()
    48     except:
    49         threw = True
    51     harness.ok(threw,
    52                "A nullable union type with a nullable member type should have "
    53                "thrown.")

mercurial