michael@0: def WebIDLTest(parser, harness): michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface I { michael@0: [PutForwards=B] readonly attribute long A; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.") michael@0: michael@0: parser = parser.reset(); michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface I { michael@0: [PutForwards=B] readonly attribute J A; michael@0: }; michael@0: interface J { michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.") michael@0: michael@0: parser = parser.reset(); michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface I { michael@0: [PutForwards=B] attribute J A; michael@0: }; michael@0: interface J { michael@0: attribute long B; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.") michael@0: michael@0: parser = parser.reset(); michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface I { michael@0: [PutForwards=B] static readonly attribute J A; michael@0: }; michael@0: interface J { michael@0: attribute long B; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.") michael@0: michael@0: parser = parser.reset(); michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: callback interface I { michael@0: [PutForwards=B] readonly attribute J A; michael@0: }; michael@0: interface J { michael@0: attribute long B; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.") michael@0: michael@0: parser = parser.reset(); michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface I { michael@0: [PutForwards=C] readonly attribute J A; michael@0: [PutForwards=C] readonly attribute J B; michael@0: }; michael@0: interface J { michael@0: [PutForwards=D] readonly attribute K C; michael@0: }; michael@0: interface K { michael@0: [PutForwards=A] readonly attribute I D; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown.")