diff options
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_attr.py')
-rw-r--r-- | components/script/dom/bindings/codegen/parser/tests/test_attr.py | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/parser/tests/test_attr.py b/components/script/dom/bindings/codegen/parser/tests/test_attr.py index 6b6142b6243..fb0c9196460 100644 --- a/components/script/dom/bindings/codegen/parser/tests/test_attr.py +++ b/components/script/dom/bindings/codegen/parser/tests/test_attr.py @@ -293,10 +293,49 @@ def WebIDLTest(parser, harness): try: parser.parse(""" interface A { - [SetterInfallible] readonly attribute boolean foo; + [SetterThrows] readonly attribute boolean foo; }; """) results = parser.finish() except Exception, x: threw = True - harness.ok(threw, "Should not allow [SetterInfallible] on readonly attributes") + harness.ok(threw, "Should not allow [SetterThrows] on readonly attributes") + + parser = parser.reset() + threw = False + try: + parser.parse(""" + interface A { + [Throw] readonly attribute boolean foo; + }; + """) + results = parser.finish() + except Exception, x: + threw = True + harness.ok(threw, "Should spell [Throws] correctly") + + parser = parser.reset() + threw = False + try: + parser.parse(""" + interface A { + [SameObject] readonly attribute boolean foo; + }; + """) + results = parser.finish() + except Exception, x: + threw = True + harness.ok(threw, "Should not allow [SameObject] on attributes not of interface type") + + parser = parser.reset() + threw = False + try: + parser.parse(""" + interface A { + [SameObject] readonly attribute A foo; + }; + """) + results = parser.finish() + except Exception, x: + threw = True + harness.ok(not threw, "Should allow [SameObject] on attributes of interface type") |