Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_unenumerable_own_properties.py
blobf465598efd5f3a1811e7fbb1d274f52a0721020d
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 parser.parse(
6 """
7 interface Foo {};
8 [LegacyUnenumerableNamedProperties]
9 interface Bar : Foo {
10 getter long(DOMString name);
12 interface Baz : Bar {
13 getter long(DOMString name);
15 """
17 results = parser.finish()
18 harness.check(len(results), 3, "Should have three interfaces")
20 parser = parser.reset()
21 threw = False
22 try:
23 parser.parse(
24 """
25 [LegacyUnenumerableNamedProperties]
26 interface NoNamedGetter {
28 """
31 results = parser.finish()
32 except WebIDL.WebIDLError:
33 threw = True
34 harness.ok(threw, "Should have thrown.")
36 parser = parser.reset()
37 threw = False
38 try:
39 parser.parse(
40 """
41 [LegacyUnenumerableNamedProperties=Foo]
42 interface ShouldNotHaveArg {
43 getter long(DOMString name);
45 """
48 results = parser.finish()
49 except WebIDL.WebIDLError:
50 threw = True
51 harness.ok(threw, "Should have thrown.")
53 parser = parser.reset()
54 threw = False
55 try:
56 parser.parse(
57 """
58 [LegacyUnenumerableNamedProperties]
59 interface Foo {
60 getter long(DOMString name);
62 interface Bar : Foo {};
63 [LegacyUnenumerableNamedProperties]
64 interface Baz : Bar {
65 getter long(DOMString name);
67 """
70 results = parser.finish()
71 except WebIDL.WebIDLError:
72 threw = True
73 harness.ok(threw, "Should have thrown.")