aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/parser/tests/test_stringifier.py
diff options
context:
space:
mode:
authorAgostonSzepessy <agszepp@gmail.com>2016-03-06 18:47:35 -0500
committerAgostonSzepessy <agszepp@gmail.com>2016-03-22 23:13:30 -0400
commitd3528ffce4092e0b28b9494f96555368bf8945b9 (patch)
treeaf13c09d65a3a61e6131b96e4aa45e6bab27905b /components/script/dom/bindings/codegen/parser/tests/test_stringifier.py
parent003fdd41769652188a5954e6499f3cb44eef6b10 (diff)
downloadservo-d3528ffce4092e0b28b9494f96555368bf8945b9.tar.gz
servo-d3528ffce4092e0b28b9494f96555368bf8945b9.zip
components/script/dom/bindings/codegen/parser/update.sh now downloads all
the latest *.py tests from https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_stringifier.py')
-rw-r--r--components/script/dom/bindings/codegen/parser/tests/test_stringifier.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/components/script/dom/bindings/codegen/parser/tests/test_stringifier.py b/components/script/dom/bindings/codegen/parser/tests/test_stringifier.py
new file mode 100644
index 00000000000..14c2c5226fc
--- /dev/null
+++ b/components/script/dom/bindings/codegen/parser/tests/test_stringifier.py
@@ -0,0 +1,46 @@
+import WebIDL
+
+def WebIDLTest(parser, harness):
+ parser.parse("""
+ interface TestStringifier {
+ stringifier;
+ };
+ """)
+
+ results = parser.finish()
+
+ harness.ok(isinstance(results[0].members[0], WebIDL.IDLMethod),
+ "Stringifer should be method")
+
+ parser = parser.reset()
+
+ threw = False
+ try:
+ parser.parse("""
+ interface TestStringifier {
+ stringifier;
+ stringifier;
+ };
+ """)
+ results = parser.finish()
+ except:
+ threw = True
+
+ harness.ok(threw, "Should not allow two 'stringifier;'")
+
+ parser = parser.reset()
+
+ threw = False
+ try:
+ parser.parse("""
+ interface TestStringifier {
+ stringifier;
+ stringifier DOMString foo();
+ };
+ """)
+ results = parser.finish()
+ except:
+ threw = True
+
+ harness.ok(threw, "Should not allow a 'stringifier;' and a 'stringifier()'")
+