Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_putForwards.py
blobee4441416c9668b11dd9cd5a1311b47d47c0f7bb
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 threw = False
6 try:
7 parser.parse(
8 """
9 interface I {
10 [PutForwards=B] readonly attribute long A;
12 """
15 parser.finish()
16 except WebIDL.WebIDLError:
17 threw = True
19 harness.ok(threw, "Should have thrown.")
21 parser = parser.reset()
22 threw = False
23 try:
24 parser.parse(
25 """
26 interface I {
27 [PutForwards=B] readonly attribute J A;
29 interface J {
31 """
34 parser.finish()
35 except WebIDL.WebIDLError:
36 threw = True
38 harness.ok(threw, "Should have thrown.")
40 parser = parser.reset()
41 threw = False
42 try:
43 parser.parse(
44 """
45 interface I {
46 [PutForwards=B] attribute J A;
48 interface J {
49 attribute long B;
51 """
54 parser.finish()
55 except WebIDL.WebIDLError:
56 threw = True
58 harness.ok(threw, "Should have thrown.")
60 parser = parser.reset()
61 threw = False
62 try:
63 parser.parse(
64 """
65 interface I {
66 [PutForwards=B] static readonly attribute J A;
68 interface J {
69 attribute long B;
71 """
74 parser.finish()
75 except WebIDL.WebIDLError:
76 threw = True
78 harness.ok(threw, "Should have thrown.")
80 parser = parser.reset()
81 threw = False
82 try:
83 parser.parse(
84 """
85 callback interface I {
86 [PutForwards=B] readonly attribute J A;
88 interface J {
89 attribute long B;
91 """
94 parser.finish()
95 except WebIDL.WebIDLError:
96 threw = True
98 harness.ok(threw, "Should have thrown.")
100 parser = parser.reset()
101 threw = False
102 try:
103 parser.parse(
105 interface I {
106 [PutForwards=C] readonly attribute J A;
107 [PutForwards=C] readonly attribute J B;
109 interface J {
110 [PutForwards=D] readonly attribute K C;
112 interface K {
113 [PutForwards=A] readonly attribute I D;
118 parser.finish()
119 except WebIDL.WebIDLError:
120 threw = True
122 harness.ok(threw, "Should have thrown.")
124 parser = parser.reset()
125 threw = False
126 try:
127 parser.parse(
129 interface I {
130 [PutForwards=B] readonly attribute K A;
132 interface J {
133 readonly attribute long B;
135 interface K : J {
140 parser.finish()
141 except WebIDL.WebIDLError:
142 threw = True
144 harness.ok(
145 not threw,
146 "PutForwards should be able to forward to an attribute on an "
147 "inherited interface.",