mirror of
https://github.com/servo/servo
synced 2026-04-28 10:27:40 +02:00
Update WebIDL
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user