1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bindings/parser/tests/test_constructor_no_interface_object.py Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +def WebIDLTest(parser, harness): 1.5 + threw = False 1.6 + try: 1.7 + parser.parse(""" 1.8 + [Constructor, NoInterfaceObject] 1.9 + interface TestConstructorNoInterfaceObject { 1.10 + }; 1.11 + """) 1.12 + 1.13 + results = parser.finish() 1.14 + except: 1.15 + threw = True 1.16 + 1.17 + harness.ok(threw, "Should have thrown.") 1.18 + 1.19 + threw = False 1.20 + try: 1.21 + parser.parse(""" 1.22 + [NoInterfaceObject, Constructor] 1.23 + interface TestConstructorNoInterfaceObject { 1.24 + }; 1.25 + """) 1.26 + 1.27 + results = parser.finish() 1.28 + except: 1.29 + threw = True 1.30 + 1.31 + harness.ok(threw, "Should have thrown.") 1.32 + 1.33 + parser = parser.reset() 1.34 + 1.35 + parser.parse(""" 1.36 + [NoInterfaceObject, NamedConstructor=FooBar] 1.37 + interface TestNamedConstructorNoInterfaceObject { 1.38 + }; 1.39 + """)