Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Side by Side Diff: pkg/analyzer/test/src/summary/linker_test.dart

Issue 2353433002: Use configurations and declared variables to select import/export URIs during prelinking. (Closed)
Patch Set: Cache selected URI. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import 'package:analyzer/dart/element/type.dart'; 5 import 'package:analyzer/dart/element/type.dart';
6 import 'package:analyzer/src/dart/element/element.dart'; 6 import 'package:analyzer/src/dart/element/element.dart';
7 import 'package:analyzer/src/summary/format.dart'; 7 import 'package:analyzer/src/summary/format.dart';
8 import 'package:analyzer/src/summary/idl.dart'; 8 import 'package:analyzer/src/summary/idl.dart';
9 import 'package:analyzer/src/summary/link.dart'; 9 import 'package:analyzer/src/summary/link.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 15 matching lines...) Expand all
26 @override 26 @override
27 bool get allowMissingFiles => false; 27 bool get allowMissingFiles => false;
28 28
29 Matcher get isUndefined => new isInstanceOf<UndefinedElementForLink>(); 29 Matcher get isUndefined => new isInstanceOf<UndefinedElementForLink>();
30 30
31 LibraryElementInBuildUnit get testLibrary => _testLibrary ??= 31 LibraryElementInBuildUnit get testLibrary => _testLibrary ??=
32 linker.getLibrary(linkerInputs.testDartUri) as LibraryElementInBuildUnit; 32 linker.getLibrary(linkerInputs.testDartUri) as LibraryElementInBuildUnit;
33 33
34 void createLinker(String text, {String path: '/test.dart'}) { 34 void createLinker(String text, {String path: '/test.dart'}) {
35 linkerInputs = createLinkerInputs(text, path: path); 35 linkerInputs = createLinkerInputs(text, path: path);
36 Map<String, LinkedLibraryBuilder> linkedLibraries = 36 Map<String, LinkedLibraryBuilder> linkedLibraries = setupForLink(
37 setupForLink(linkerInputs.linkedLibraries, linkerInputs.getUnit); 37 linkerInputs.linkedLibraries,
38 linkerInputs.getUnit,
39 linkerInputs.getDeclaredVariable);
38 linker = new Linker(linkedLibraries, linkerInputs.getDependency, 40 linker = new Linker(linkedLibraries, linkerInputs.getDependency,
39 linkerInputs.getUnit, true); 41 linkerInputs.getUnit, true);
40 } 42 }
41 43
42 LibraryElementForLink getLibrary(String uri) { 44 LibraryElementForLink getLibrary(String uri) {
43 return linker.getLibrary(Uri.parse(uri)); 45 return linker.getLibrary(Uri.parse(uri));
44 } 46 }
45 47
46 void test_apiSignature_apiChanges() { 48 void test_apiSignature_apiChanges() {
47 var bundle0 = 49 var bundle0 =
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 PropertyAccessorElementForLink_Variable j = library.getContainedName('j'); 910 PropertyAccessorElementForLink_Variable j = library.getContainedName('j');
909 expect(j.variable.initializer, isNull); 911 expect(j.variable.initializer, isNull);
910 PropertyAccessorElementForLink_Variable v = library.getContainedName('v'); 912 PropertyAccessorElementForLink_Variable v = library.getContainedName('v');
911 expect(v.variable.initializer, isNotNull); 913 expect(v.variable.initializer, isNotNull);
912 } 914 }
913 915
914 VariableElementForLink _getVariable(ReferenceableElementForLink element) { 916 VariableElementForLink _getVariable(ReferenceableElementForLink element) {
915 return (element as PropertyAccessorElementForLink_Variable).variable; 917 return (element as PropertyAccessorElementForLink_Variable).variable;
916 } 918 }
917 } 919 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/pub_summary.dart ('k') | pkg/analyzer/test/src/summary/prelinker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698