summaryrefslogtreecommitdiffstats
path: root/dom/bindings/parser/tests/test_constructor_no_interface_object.py
diff options
context:
space:
mode:
Diffstat (limited to 'dom/bindings/parser/tests/test_constructor_no_interface_object.py')
-rw-r--r--dom/bindings/parser/tests/test_constructor_no_interface_object.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/bindings/parser/tests/test_constructor_no_interface_object.py b/dom/bindings/parser/tests/test_constructor_no_interface_object.py
new file mode 100644
index 0000000000..513a9ab3f8
--- /dev/null
+++ b/dom/bindings/parser/tests/test_constructor_no_interface_object.py
@@ -0,0 +1,47 @@
+def WebIDLTest(parser, harness):
+ threw = False
+ try:
+ parser.parse(
+ """
+ [LegacyNoInterfaceObject]
+ interface TestConstructorLegacyNoInterfaceObject {
+ constructor();
+ };
+ """
+ )
+
+ parser.finish()
+ except Exception:
+ threw = True
+
+ harness.ok(threw, "Should have thrown.")
+
+ parser = parser.reset()
+
+ parser.parse(
+ """
+ [LegacyNoInterfaceObject, LegacyFactoryFunction=FooBar]
+ interface TestLegacyFactoryFunctionLegacyNoInterfaceObject {
+ };
+ """
+ )
+
+ # Test HTMLConstructor and LegacyNoInterfaceObject
+ parser = parser.reset()
+
+ threw = False
+ try:
+ parser.parse(
+ """
+ [LegacyNoInterfaceObject]
+ interface TestHTMLConstructorLegacyNoInterfaceObject {
+ [HTMLConstructor] constructor();
+ };
+ """
+ )
+
+ parser.finish()
+ except Exception:
+ threw = True
+
+ harness.ok(threw, "Should have thrown.")