aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_cereactions.py')
-rw-r--r--components/script/dom/bindings/codegen/parser/tests/test_cereactions.py80
1 files changed, 52 insertions, 28 deletions
diff --git a/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py b/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
index ebc688bfd9c..c56c3dbde10 100644
--- a/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
+++ b/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
@@ -1,11 +1,13 @@
def WebIDLTest(parser, harness):
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions(DOMString a)] undefined foo(boolean arg2);
};
- """)
+ """
+ )
results = parser.finish()
except:
@@ -16,11 +18,13 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions(DOMString b)] readonly attribute boolean bar;
};
- """)
+ """
+ )
results = parser.finish()
except:
@@ -31,54 +35,72 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] attribute boolean bar;
};
- """)
+ """
+ )
results = parser.finish()
except Exception as e:
- harness.ok(False, "Shouldn't have thrown for [CEReactions] used on writable attribute. %s" % e)
+ harness.ok(
+ False,
+ "Shouldn't have thrown for [CEReactions] used on writable attribute. %s"
+ % e,
+ )
threw = True
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] undefined foo(boolean arg2);
};
- """)
+ """
+ )
results = parser.finish()
except Exception as e:
- harness.ok(False, "Shouldn't have thrown for [CEReactions] used on regular operations. %s" % e)
+ harness.ok(
+ False,
+ "Shouldn't have thrown for [CEReactions] used on regular operations. %s"
+ % e,
+ )
threw = True
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] readonly attribute boolean A;
};
- """)
+ """
+ )
results = parser.finish()
except:
threw = True
- harness.ok(threw, "Should have thrown for [CEReactions] used on a readonly attribute")
+ harness.ok(
+ threw, "Should have thrown for [CEReactions] used on a readonly attribute"
+ )
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
[CEReactions]
interface Foo {
}
- """)
+ """
+ )
results = parser.finish()
except:
@@ -89,45 +111,47 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] getter any(DOMString name);
};
- """)
+ """
+ )
results = parser.finish()
except:
threw = True
- harness.ok(threw,
- "Should have thrown for [CEReactions] used on a named getter")
+ harness.ok(threw, "Should have thrown for [CEReactions] used on a named getter")
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] legacycaller double compute(double x);
};
- """)
+ """
+ )
results = parser.finish()
except:
threw = True
- harness.ok(threw,
- "Should have thrown for [CEReactions] used on a legacycaller")
+ harness.ok(threw, "Should have thrown for [CEReactions] used on a legacycaller")
parser = parser.reset()
threw = False
try:
- parser.parse("""
+ parser.parse(
+ """
interface Foo {
[CEReactions] stringifier DOMString ();
};
- """)
+ """
+ )
results = parser.finish()
except:
threw = True
- harness.ok(threw,
- "Should have thrown for [CEReactions] used on a stringifier")
-
+ harness.ok(threw, "Should have thrown for [CEReactions] used on a stringifier")