OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 import "dart:_js_helper"; |
5 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
6 | 7 |
7 // Test for dartNativeDispatchHooksTransformer | 8 // Test for dartNativeDispatchHooksTransformer |
8 // - uncached, instance, leaf and interior caching modes. | 9 // - uncached, instance, leaf and interior caching modes. |
9 // - composition of getTag. | 10 // - composition of getTag. |
10 | 11 |
11 class T1A native "T1A" { | 12 @Native("T1A") |
| 13 class T1A { |
12 foo() native; | 14 foo() native; |
13 } | 15 } |
14 | 16 |
15 class T1B native "T1B" { | 17 @Native("T1B") |
| 18 class T1B { |
16 foo() native; | 19 foo() native; |
17 } | 20 } |
18 | 21 |
19 class T1C native "T1C" { | 22 @Native("T1C") |
| 23 class T1C { |
20 foo() native; | 24 foo() native; |
21 } | 25 } |
22 | 26 |
23 class T1D native "T1D" { | 27 @Native("T1D") |
| 28 class T1D { |
24 foo() native; | 29 foo() native; |
25 } | 30 } |
26 | 31 |
27 makeT1A() native; | 32 makeT1A() native; |
28 makeT1B() native; | 33 makeT1B() native; |
29 makeT1C() native; | 34 makeT1C() native; |
30 makeT1D() native; | 35 makeT1D() native; |
31 | 36 |
32 int getTagCallCount() native; | 37 int getTagCallCount() native; |
33 void clearTagCallCount() native; | 38 void clearTagCallCount() native; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 '2 = 1 fresh instance + 1 uncached (+ 2 proto cached)'); | 138 '2 = 1 fresh instance + 1 uncached (+ 2 proto cached)'); |
134 | 139 |
135 clearTagCallCount(); | 140 clearTagCallCount(); |
136 Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A'); | 141 Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A'); |
137 Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B'); | 142 Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B'); |
138 Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C'); | 143 Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C'); |
139 Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D'); | 144 Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D'); |
140 Expect.equals(1, getTagCallCount(), | 145 Expect.equals(1, getTagCallCount(), |
141 '1 = 2 proto cached + 1 instance cached + 1 uncached'); | 146 '1 = 2 proto cached + 1 instance cached + 1 uncached'); |
142 } | 147 } |
OLD | NEW |