OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.serialization.native_data_test; | 5 library dart2js.serialization.native_data_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:compiler/src/common/names.dart'; | 9 import 'package:compiler/src/common/names.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
(...skipping 29 matching lines...) Expand all Loading... |
40 print('analyze deserialized: $uri'); | 40 print('analyze deserialized: $uri'); |
41 print('------------------------------------------------------------------'); | 41 print('------------------------------------------------------------------'); |
42 Compiler compiler2 = compilerFor( | 42 Compiler compiler2 = compilerFor( |
43 memorySourceFiles: serializedData.toMemorySourceFiles(), | 43 memorySourceFiles: serializedData.toMemorySourceFiles(), |
44 resolutionInputs: serializedData.toUris(), | 44 resolutionInputs: serializedData.toUris(), |
45 options: [Flags.analyzeAll]); | 45 options: [Flags.analyzeAll]); |
46 await compiler2.run(uri); | 46 await compiler2.run(uri); |
47 | 47 |
48 JavaScriptBackend backend1 = compiler1.backend; | 48 JavaScriptBackend backend1 = compiler1.backend; |
49 JavaScriptBackend backend2 = compiler2.backend; | 49 JavaScriptBackend backend2 = compiler2.backend; |
50 NativeClassDataImpl nativeClassData1 = backend1.nativeClassData; | 50 NativeBasicDataImpl nativeBaseData1 = backend1.nativeBaseData; |
51 NativeClassDataImpl nativeClassData2 = backend2.nativeClassData; | 51 NativeBasicDataImpl nativeBaseData2 = backend2.nativeBaseData; |
52 NativeDataImpl nativeData1 = backend1.nativeData; | 52 NativeDataImpl nativeData1 = backend1.nativeData; |
53 NativeDataImpl nativeData2 = backend2.nativeData; | 53 NativeDataImpl nativeData2 = backend2.nativeData; |
54 | 54 |
55 checkMaps( | 55 checkMaps( |
56 nativeData1.jsInteropLibraryNames, | 56 nativeData1.jsInteropLibraryNames, |
57 nativeData2.jsInteropLibraryNames, | 57 nativeData2.jsInteropLibraryNames, |
58 "NativeData.jsInteropLibraryNames", | 58 "NativeData.jsInteropLibraryNames", |
59 areElementsEquivalent, | 59 areElementsEquivalent, |
60 equality, | 60 equality, |
61 verbose: verbose); | 61 verbose: verbose); |
62 | 62 |
63 checkMaps(nativeData1.jsInteropClassNames, nativeData2.jsInteropClassNames, | 63 checkMaps(nativeData1.jsInteropClassNames, nativeData2.jsInteropClassNames, |
64 "NativeData.jsInteropClassNames", areElementsEquivalent, equality, | 64 "NativeData.jsInteropClassNames", areElementsEquivalent, equality, |
65 verbose: verbose); | 65 verbose: verbose); |
66 | 66 |
67 checkMaps(nativeData1.jsInteropMemberNames, nativeData2.jsInteropMemberNames, | 67 checkMaps(nativeData1.jsInteropMemberNames, nativeData2.jsInteropMemberNames, |
68 "NativeData.jsInteropMemberNames", areElementsEquivalent, equality, | 68 "NativeData.jsInteropMemberNames", areElementsEquivalent, equality, |
69 verbose: verbose); | 69 verbose: verbose); |
70 | 70 |
71 checkMaps(nativeData1.nativeMemberName, nativeData2.nativeMemberName, | 71 checkMaps(nativeData1.nativeMemberName, nativeData2.nativeMemberName, |
72 "NativeData.nativeMemberName", areElementsEquivalent, equality, | 72 "NativeData.nativeMemberName", areElementsEquivalent, equality, |
73 verbose: verbose); | 73 verbose: verbose); |
74 | 74 |
75 checkMaps( | 75 checkMaps( |
76 nativeClassData1.nativeClassTagInfo, | 76 nativeBaseData1.nativeClassTagInfo, |
77 nativeClassData2.nativeClassTagInfo, | 77 nativeBaseData2.nativeClassTagInfo, |
78 "NativeData.nativeClassTagInfo", | 78 "NativeData.nativeClassTagInfo", |
79 areElementsEquivalent, | 79 areElementsEquivalent, |
80 equality, | 80 equality, |
81 verbose: verbose); | 81 verbose: verbose); |
82 | 82 |
83 checkMaps( | 83 checkMaps( |
84 nativeData1.nativeMethodBehavior, | 84 nativeData1.nativeMethodBehavior, |
85 nativeData2.nativeMethodBehavior, | 85 nativeData2.nativeMethodBehavior, |
86 "NativeData.nativeMethodBehavior", | 86 "NativeData.nativeMethodBehavior", |
87 areElementsEquivalent, | 87 areElementsEquivalent, |
88 testNativeBehavior, | 88 testNativeBehavior, |
89 verbose: verbose); | 89 verbose: verbose); |
90 | 90 |
91 checkMaps( | 91 checkMaps( |
92 nativeData1.nativeFieldLoadBehavior, | 92 nativeData1.nativeFieldLoadBehavior, |
93 nativeData2.nativeFieldLoadBehavior, | 93 nativeData2.nativeFieldLoadBehavior, |
94 "NativeData.nativeFieldLoadBehavior", | 94 "NativeData.nativeFieldLoadBehavior", |
95 areElementsEquivalent, | 95 areElementsEquivalent, |
96 testNativeBehavior, | 96 testNativeBehavior, |
97 verbose: verbose); | 97 verbose: verbose); |
98 | 98 |
99 checkMaps( | 99 checkMaps( |
100 nativeData1.nativeFieldStoreBehavior, | 100 nativeData1.nativeFieldStoreBehavior, |
101 nativeData2.nativeFieldStoreBehavior, | 101 nativeData2.nativeFieldStoreBehavior, |
102 "NativeData.nativeFieldStoreBehavior", | 102 "NativeData.nativeFieldStoreBehavior", |
103 areElementsEquivalent, | 103 areElementsEquivalent, |
104 testNativeBehavior, | 104 testNativeBehavior, |
105 verbose: verbose); | 105 verbose: verbose); |
106 } | 106 } |
OLD | NEW |