mirror of
https://github.com/servo/servo
synced 2026-04-28 10:27:40 +02:00
Sync WebIDL.py with gecko
This commit is contained in:
@@ -374,3 +374,89 @@ def WebIDLTest(parser, harness):
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow unknown extended attributes on interfaces")
|
||||
|
||||
parser = parser.reset()
|
||||
parser.parse("""
|
||||
[Global] interface Window {};
|
||||
[Exposed=Window, LegacyWindowAlias=A]
|
||||
interface B {};
|
||||
[Exposed=Window, LegacyWindowAlias=(C, D)]
|
||||
interface E {};
|
||||
""");
|
||||
results = parser.finish();
|
||||
harness.check(results[1].legacyWindowAliases, ["A"],
|
||||
"Should support a single identifier")
|
||||
harness.check(results[2].legacyWindowAliases, ["C", "D"],
|
||||
"Should support an identifier list")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[LegacyWindowAlias]
|
||||
interface A {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow [LegacyWindowAlias] with no value")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[Exposed=Worker, LegacyWindowAlias=B]
|
||||
interface A {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow [LegacyWindowAlias] without Window exposure")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[Global] interface Window {};
|
||||
interface A {};
|
||||
[Exposed=Window, LegacyWindowAlias=A]
|
||||
interface B {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow [LegacyWindowAlias] to conflict with other identifiers")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[Global] interface Window {};
|
||||
[Exposed=Window, LegacyWindowAlias=A]
|
||||
interface B {};
|
||||
interface A {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow [LegacyWindowAlias] to conflict with other identifiers")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[Global] interface Window {};
|
||||
[Exposed=Window, LegacyWindowAlias=A]
|
||||
interface B {};
|
||||
[Exposed=Window, LegacyWindowAlias=A]
|
||||
interface C {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
harness.ok(threw,
|
||||
"Should not allow [LegacyWindowAlias] to conflict with other identifiers")
|
||||
|
||||
Reference in New Issue
Block a user