aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/parser/tests/test_method.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_method.py')
-rw-r--r--components/script/dom/bindings/codegen/parser/tests/test_method.py47
1 files changed, 43 insertions, 4 deletions
diff --git a/components/script/dom/bindings/codegen/parser/tests/test_method.py b/components/script/dom/bindings/codegen/parser/tests/test_method.py
index 40b2d2cf8b9..f6f54c33ab6 100644
--- a/components/script/dom/bindings/codegen/parser/tests/test_method.py
+++ b/components/script/dom/bindings/codegen/parser/tests/test_method.py
@@ -123,23 +123,62 @@ def WebIDLTest(parser, harness):
try:
parser.parse("""
interface A {
- [GetterInfallible] void foo();
+ void foo(optional float bar = 1);
};
""")
results = parser.finish()
except Exception, x:
threw = True
- harness.ok(threw, "Should not allow [GetterInfallible] on methods")
+ harness.ok(not threw, "Should allow integer to float type corecion")
parser = parser.reset()
threw = False
try:
parser.parse("""
interface A {
- [SetterInfallible] void foo();
+ [GetterThrows] void foo();
};
""")
results = parser.finish()
except Exception, x:
threw = True
- harness.ok(threw, "Should not allow [SetterInfallible] on methods")
+ harness.ok(threw, "Should not allow [GetterThrows] on methods")
+
+ parser = parser.reset()
+ threw = False
+ try:
+ parser.parse("""
+ interface A {
+ [SetterThrows] void foo();
+ };
+ """)
+ results = parser.finish()
+ except Exception, x:
+ threw = True
+ harness.ok(threw, "Should not allow [SetterThrows] on methods")
+
+ parser = parser.reset()
+ threw = False
+ try:
+ parser.parse("""
+ interface A {
+ [Throw] void foo();
+ };
+ """)
+ results = parser.finish()
+ except Exception, x:
+ threw = True
+ harness.ok(threw, "Should spell [Throws] correctly on methods")
+
+ parser = parser.reset()
+ threw = False
+ try:
+ parser.parse("""
+ interface A {
+ void __noSuchMethod__();
+ };
+ """)
+ results = parser.finish()
+ except Exception, x:
+ threw = True
+ harness.ok(threw, "Should not allow __noSuchMethod__ methods")