| 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 'package:analyzer/src/generated/element.dart'; | 7 import 'package:analyzer/src/generated/element.dart'; |
| 8 import 'package:analyzer/src/generated/element_handle.dart'; | 8 import 'package:analyzer/src/generated/element_handle.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/resolver.dart' show Namespace; | 10 import 'package:analyzer/src/generated/resolver.dart' show Namespace; |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 return serializedLibrary; | 606 return serializedLibrary; |
| 607 } | 607 } |
| 608 UnlinkedUnit getUnlinkedSummary(String uri) { | 608 UnlinkedUnit getUnlinkedSummary(String uri) { |
| 609 UnlinkedUnit serializedUnit = unlinkedSummaries[uri]; | 609 UnlinkedUnit serializedUnit = unlinkedSummaries[uri]; |
| 610 if (serializedUnit == null) { | 610 if (serializedUnit == null) { |
| 611 fail('Unexpectedly tried to get unlinked summary for $uri'); | 611 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 612 } | 612 } |
| 613 return serializedUnit; | 613 return serializedUnit; |
| 614 } | 614 } |
| 615 SummaryResynthesizer resynthesizer = new SummaryResynthesizer( | 615 SummaryResynthesizer resynthesizer = new SummaryResynthesizer( |
| 616 null, |
| 616 analysisContext, | 617 analysisContext, |
| 617 analysisContext.typeProvider, | 618 analysisContext.typeProvider, |
| 619 (_) => true, |
| 618 getPrelinkedSummary, | 620 getPrelinkedSummary, |
| 619 getUnlinkedSummary, | 621 getUnlinkedSummary, |
| 620 analysisContext.sourceFactory); | 622 analysisContext.sourceFactory); |
| 621 LibraryElementImpl resynthesized = resynthesizer.getLibraryElement(uri); | 623 LibraryElementImpl resynthesized = resynthesizer.getLibraryElement(uri); |
| 622 // Check that no other summaries needed to be resynthesized to resynthesize | 624 // Check that no other summaries needed to be resynthesized to resynthesize |
| 623 // the library element. | 625 // the library element. |
| 624 expect(resynthesizer.resynthesisCount, 1); | 626 expect(resynthesizer.resynthesisCount, 1); |
| 625 return resynthesized; | 627 return resynthesized; |
| 626 } | 628 } |
| 627 | 629 |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 test_variable_setterInPart_getterInPart() { | 1581 test_variable_setterInPart_getterInPart() { |
| 1580 addNamedSource('/a.dart', 'part of my.lib; void set x(int _) {}'); | 1582 addNamedSource('/a.dart', 'part of my.lib; void set x(int _) {}'); |
| 1581 addNamedSource('/b.dart', 'part of my.lib; int get x => 42;'); | 1583 addNamedSource('/b.dart', 'part of my.lib; int get x => 42;'); |
| 1582 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); | 1584 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); |
| 1583 } | 1585 } |
| 1584 | 1586 |
| 1585 test_variables() { | 1587 test_variables() { |
| 1586 checkLibrary('int i; int j;'); | 1588 checkLibrary('int i; int j;'); |
| 1587 } | 1589 } |
| 1588 } | 1590 } |
| OLD | NEW |