update to latest tests

This commit is contained in:
Prabhjyot Singh Sodhi
2016-01-22 02:57:06 +05:30
committed by Prabhjyot Singh Sodhi
parent 175b3c2d27
commit da40818f25
8 changed files with 156 additions and 29 deletions

View File

@@ -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")