dom/bindings/parser/tests/test_promise.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 Promise {};
     6             interface A {
     7               legacycaller Promise foo();
     8             };
     9         """)
    10         results = parser.finish()
    12     except:
    13         threw = True
    14     harness.ok(threw,
    15                "Should not allow Promise return values for legacycaller.")
    17     parser = parser.reset()
    18     threw = False
    19     try:
    20         parser.parse("""
    21             interface Promise {};
    22             interface A {
    23               Promise foo();
    24               long foo(long arg);
    25             };
    26         """)
    27         results = parser.finish();
    28     except:
    29         threw = True
    30     harness.ok(threw,
    31                "Should not allow overloads which have both Promise and "
    32                "non-Promise return types.")
    34     parser = parser.reset()
    35     threw = False
    36     try:
    37         parser.parse("""
    38             interface Promise {};
    39             interface A {
    40               long foo(long arg);
    41               Promise foo();
    42             };
    43         """)
    44         results = parser.finish();
    45     except:
    46         threw = True
    47     harness.ok(threw,
    48                "Should not allow overloads which have both Promise and "
    49                "non-Promise return types.")
    51     parser = parser.reset()
    52     parser.parse("""
    53         interface Promise {};
    54         interface A {
    55           Promise foo();
    56           Promise foo(long arg);
    57         };
    58     """)
    59     results = parser.finish();
    61     harness.ok(True,
    62                "Should allow overloads which only have Promise and return "
    63                "types.")

mercurial