dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.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 IdentifierConflictAcrossMembers1 {
     6               const byte thing1 = 1;
     7               readonly attribute long thing1;
     8             };
     9         """)
    11         results = parser.finish()
    12     except:
    13         threw = True
    15     harness.ok(threw, "Should have thrown.")
    17     threw = False
    18     try:
    19         parser.parse("""
    20             interface IdentifierConflictAcrossMembers2 {
    21               readonly attribute long thing1;
    22               const byte thing1 = 1;
    23             };
    24         """)
    26         results = parser.finish()
    27     except:
    28         threw = True
    30     harness.ok(threw, "Should have thrown.")
    32     threw = False
    33     try:
    34         parser.parse("""
    35             interface IdentifierConflictAcrossMembers3 {
    36               getter boolean thing1(DOMString name);
    37               readonly attribute long thing1;
    38             };
    39         """)
    41         results = parser.finish()
    42     except:
    43         threw = True
    45     harness.ok(threw, "Should have thrown.")
    47     threw = False
    48     try:
    49         parser.parse("""
    50             interface IdentifierConflictAcrossMembers1 {
    51               const byte thing1 = 1;
    52               long thing1();
    53             };
    54         """)
    56         results = parser.finish()
    57     except:
    58         threw = True
    60     harness.ok(threw, "Should have thrown.")

mercurial