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

Side by Side Diff: pkg/analyzer/test/src/summary/summary_common.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) 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 analyzer.test.src.summary.summary_common; 5 library analyzer.test.src.summary.summary_common;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/error/listener.dart'; 10 import 'package:analyzer/error/listener.dart';
(...skipping 6044 matching lines...) Expand 10 before | Expand all | Expand 10 after
6055 expect(linked.exportNames, hasLength(1)); 6055 expect(linked.exportNames, hasLength(1));
6056 checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'C', 6056 checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'C',
6057 ReferenceKind.classOrEnum); 6057 ReferenceKind.classOrEnum);
6058 } 6058 }
6059 6059
6060 test_export_configurations() { 6060 test_export_configurations() {
6061 if (!checkAstDerivedData) { 6061 if (!checkAstDerivedData) {
6062 // Element model does not provide access to configurations. 6062 // Element model does not provide access to configurations.
6063 return; 6063 return;
6064 } 6064 }
6065 addNamedSource('/foo.dart', 'bar() {}'); 6065 addNamedSource('/foo.dart', 'class A {}');
6066 addNamedSource('/foo_io.dart', 'bar() {}'); 6066 addNamedSource('/foo_io.dart', 'class A {}');
6067 addNamedSource('/foo_html.dart', 'bar() {}'); 6067 addNamedSource('/foo_html.dart', 'class A {}');
6068 String libraryText = r''' 6068 String libraryText = r'''
6069 export 'foo.dart' 6069 export 'foo.dart'
6070 if (dart.library.io) 'foo_io.dart' 6070 if (dart.library.io) 'foo_io.dart'
6071 if (dart.flavor == 'html') 'foo_html.dart'; 6071 if (dart.flavor == 'html') 'foo_html.dart';
6072
6073 class B extends A {}
6072 '''; 6074 ''';
6073 serializeLibraryText(libraryText); 6075 serializeLibraryText(libraryText);
6074 UnlinkedExportPublic exp = unlinkedUnits[0].publicNamespace.exports[0]; 6076 UnlinkedExportPublic exp = unlinkedUnits[0].publicNamespace.exports[0];
6075 expect(exp.configurations, hasLength(2)); 6077 expect(exp.configurations, hasLength(2));
6076 { 6078 {
6077 UnlinkedConfiguration configuration = exp.configurations[0]; 6079 UnlinkedConfiguration configuration = exp.configurations[0];
6078 expect(configuration.name, 'dart.library.io'); 6080 expect(configuration.name, 'dart.library.io');
6079 expect(configuration.value, 'true'); 6081 expect(configuration.value, 'true');
6080 expect(configuration.uri, 'foo_io.dart'); 6082 expect(configuration.uri, 'foo_io.dart');
6081 } 6083 }
(...skipping 4467 matching lines...) Expand 10 before | Expand all | Expand 10 after
10549 class _PrefixExpectation { 10551 class _PrefixExpectation {
10550 final ReferenceKind kind; 10552 final ReferenceKind kind;
10551 final String name; 10553 final String name;
10552 final String absoluteUri; 10554 final String absoluteUri;
10553 final String relativeUri; 10555 final String relativeUri;
10554 final int numTypeParameters; 10556 final int numTypeParameters;
10555 10557
10556 _PrefixExpectation(this.kind, this.name, 10558 _PrefixExpectation(this.kind, this.name,
10557 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 10559 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
10558 } 10560 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_test.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698