dom/bindings/parser/tests/test_stringifier.py

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 import WebIDL
     3 def WebIDLTest(parser, harness):
     4     parser.parse("""
     5         interface TestStringifier {
     6           stringifier;
     7         };
     8     """)
    10     results = parser.finish()
    12     harness.ok(isinstance(results[0].members[0], WebIDL.IDLMethod),
    13                "Stringifer should be method")
    15     parser = parser.reset()
    17     threw = False
    18     try:
    19         parser.parse("""
    20             interface TestStringifier {
    21               stringifier;
    22               stringifier;
    23             };
    24         """)
    25         results = parser.finish()
    26     except:
    27         threw = True
    29     harness.ok(threw, "Should not allow two 'stringifier;'")
    31     parser = parser.reset()
    33     threw = False
    34     try:
    35         parser.parse("""
    36             interface TestStringifier {
    37               stringifier;
    38               stringifier DOMString foo();
    39             };
    40         """)
    41         results = parser.finish()
    42     except:
    43         threw = True
    45     harness.ok(threw, "Should not allow a 'stringifier;' and a 'stringifier()'")

mercurial