dom/bindings/parser/tests/test_putForwards.py

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:624191fbdb3b
1 def WebIDLTest(parser, harness):
2 threw = False
3 try:
4 parser.parse("""
5 interface I {
6 [PutForwards=B] readonly attribute long A;
7 };
8 """)
9
10 results = parser.finish()
11 except:
12 threw = True
13
14 harness.ok(threw, "Should have thrown.")
15
16 parser = parser.reset();
17 threw = False
18 try:
19 parser.parse("""
20 interface I {
21 [PutForwards=B] readonly attribute J A;
22 };
23 interface J {
24 };
25 """)
26
27 results = parser.finish()
28 except:
29 threw = True
30
31 harness.ok(threw, "Should have thrown.")
32
33 parser = parser.reset();
34 threw = False
35 try:
36 parser.parse("""
37 interface I {
38 [PutForwards=B] attribute J A;
39 };
40 interface J {
41 attribute long B;
42 };
43 """)
44
45 results = parser.finish()
46 except:
47 threw = True
48
49 harness.ok(threw, "Should have thrown.")
50
51 parser = parser.reset();
52 threw = False
53 try:
54 parser.parse("""
55 interface I {
56 [PutForwards=B] static readonly attribute J A;
57 };
58 interface J {
59 attribute long B;
60 };
61 """)
62
63 results = parser.finish()
64 except:
65 threw = True
66
67 harness.ok(threw, "Should have thrown.")
68
69 parser = parser.reset();
70 threw = False
71 try:
72 parser.parse("""
73 callback interface I {
74 [PutForwards=B] readonly attribute J A;
75 };
76 interface J {
77 attribute long B;
78 };
79 """)
80
81 results = parser.finish()
82 except:
83 threw = True
84
85 harness.ok(threw, "Should have thrown.")
86
87 parser = parser.reset();
88 threw = False
89 try:
90 parser.parse("""
91 interface I {
92 [PutForwards=C] readonly attribute J A;
93 [PutForwards=C] readonly attribute J B;
94 };
95 interface J {
96 [PutForwards=D] readonly attribute K C;
97 };
98 interface K {
99 [PutForwards=A] readonly attribute I D;
100 };
101 """)
102
103 results = parser.finish()
104 except:
105 threw = True
106
107 harness.ok(threw, "Should have thrown.")

mercurial