| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/constant/value.dart'; | 10 import 'package:analyzer/dart/constant/value.dart'; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 } else { | 205 } else { |
| 206 expect( | 206 expect( |
| 207 resynthesizedNonHandle, isNot(new isInstanceOf<ConstructorMember>()), | 207 resynthesizedNonHandle, isNot(new isInstanceOf<ConstructorMember>()), |
| 208 reason: desc); | 208 reason: desc); |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 void compareClassElements( | 212 void compareClassElements( |
| 213 ClassElement resynthesized, ClassElement original, String desc) { | 213 ClassElement resynthesized, ClassElement original, String desc) { |
| 214 ClassElementImpl r = getActualElement(resynthesized, desc); | 214 ClassElementImpl r = ClassElementImpl.getImpl(resynthesized); |
| 215 ClassElementImpl o = getActualElement(original, desc); | 215 ClassElementImpl o = ClassElementImpl.getImpl(original); |
| 216 compareElements(r, o, desc); | 216 compareElements(r, o, desc); |
| 217 expect(r.fields.length, o.fields.length, reason: '$desc fields.length'); | 217 expect(r.fields.length, o.fields.length, reason: '$desc fields.length'); |
| 218 for (int i = 0; i < r.fields.length; i++) { | 218 for (int i = 0; i < r.fields.length; i++) { |
| 219 String name = o.fields[i].name; | 219 String name = o.fields[i].name; |
| 220 compareFieldElements(r.fields[i], o.fields[i], '$desc.field $name'); | 220 compareFieldElements(r.fields[i], o.fields[i], '$desc.field $name'); |
| 221 } | 221 } |
| 222 compareTypes(r.supertype, o.supertype, '$desc supertype'); | 222 compareTypes(r.supertype, o.supertype, '$desc supertype'); |
| 223 expect(r.interfaces.length, o.interfaces.length); | 223 expect(r.interfaces.length, o.interfaces.length); |
| 224 for (int i = 0; i < r.interfaces.length; i++) { | 224 for (int i = 0; i < r.interfaces.length; i++) { |
| 225 compareTypes(r.interfaces[i], o.interfaces[i], | 225 compareTypes(r.interfaces[i], o.interfaces[i], |
| (...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4431 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4431 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4432 } | 4432 } |
| 4433 return serializedUnit; | 4433 return serializedUnit; |
| 4434 } | 4434 } |
| 4435 | 4435 |
| 4436 @override | 4436 @override |
| 4437 bool hasLibrarySummary(String uri) { | 4437 bool hasLibrarySummary(String uri) { |
| 4438 return true; | 4438 return true; |
| 4439 } | 4439 } |
| 4440 } | 4440 } |
| OLD | NEW |