mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Create a top-level "third_party" directory
This directory now contains third_party software that is vendored into the Servo source tree. The idea is that it would eventually hold webrender and other crates from mozilla-central as well with a standard patch management approach for each.
This commit is contained in:
parent
7412e28349
commit
8be014ee46
148 changed files with 10 additions and 7 deletions
117
third_party/WebIDL/tests/test_special_methods.py
vendored
Normal file
117
third_party/WebIDL/tests/test_special_methods.py
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
import WebIDL
|
||||
|
||||
|
||||
def WebIDLTest(parser, harness):
|
||||
parser.parse(
|
||||
"""
|
||||
interface SpecialMethods {
|
||||
getter long long (unsigned long index);
|
||||
setter long long (unsigned long index, long long value);
|
||||
getter boolean (DOMString name);
|
||||
setter boolean (DOMString name, boolean value);
|
||||
deleter boolean (DOMString name);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
||||
interface SpecialMethodsCombination {
|
||||
getter deleter boolean (DOMString name);
|
||||
};
|
||||
"""
|
||||
)
|
||||
|
||||
results = parser.finish()
|
||||
|
||||
def checkMethod(
|
||||
method,
|
||||
QName,
|
||||
name,
|
||||
static=False,
|
||||
getter=False,
|
||||
setter=False,
|
||||
deleter=False,
|
||||
legacycaller=False,
|
||||
stringifier=False,
|
||||
):
|
||||
harness.ok(isinstance(method, WebIDL.IDLMethod), "Should be an IDLMethod")
|
||||
harness.check(method.identifier.QName(), QName, "Method has the right QName")
|
||||
harness.check(method.identifier.name, name, "Method has the right name")
|
||||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||
harness.check(
|
||||
method.isDeleter(), deleter, "Method has the correct deleter value"
|
||||
)
|
||||
harness.check(
|
||||
method.isLegacycaller(),
|
||||
legacycaller,
|
||||
"Method has the correct legacycaller value",
|
||||
)
|
||||
harness.check(
|
||||
method.isStringifier(),
|
||||
stringifier,
|
||||
"Method has the correct stringifier value",
|
||||
)
|
||||
|
||||
harness.check(len(results), 2, "Expect 2 interfaces")
|
||||
|
||||
iface = results[0]
|
||||
harness.check(len(iface.members), 6, "Expect 6 members")
|
||||
|
||||
checkMethod(
|
||||
iface.members[0],
|
||||
"::SpecialMethods::__indexedgetter",
|
||||
"__indexedgetter",
|
||||
getter=True,
|
||||
)
|
||||
checkMethod(
|
||||
iface.members[1],
|
||||
"::SpecialMethods::__indexedsetter",
|
||||
"__indexedsetter",
|
||||
setter=True,
|
||||
)
|
||||
checkMethod(
|
||||
iface.members[2],
|
||||
"::SpecialMethods::__namedgetter",
|
||||
"__namedgetter",
|
||||
getter=True,
|
||||
)
|
||||
checkMethod(
|
||||
iface.members[3],
|
||||
"::SpecialMethods::__namedsetter",
|
||||
"__namedsetter",
|
||||
setter=True,
|
||||
)
|
||||
checkMethod(
|
||||
iface.members[4],
|
||||
"::SpecialMethods::__nameddeleter",
|
||||
"__nameddeleter",
|
||||
deleter=True,
|
||||
)
|
||||
|
||||
iface = results[1]
|
||||
harness.check(len(iface.members), 1, "Expect 1 member")
|
||||
|
||||
checkMethod(
|
||||
iface.members[0],
|
||||
"::SpecialMethodsCombination::__namedgetterdeleter",
|
||||
"__namedgetterdeleter",
|
||||
getter=True,
|
||||
deleter=True,
|
||||
)
|
||||
|
||||
parser = parser.reset()
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse(
|
||||
"""
|
||||
interface IndexedDeleter {
|
||||
deleter undefined(unsigned long index);
|
||||
};
|
||||
"""
|
||||
)
|
||||
parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "There are no indexed deleters")
|
Loading…
Add table
Add a link
Reference in a new issue