dom/bindings/parser/tests/test_union_nullable.py

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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