| 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 analyzer.test.src.context.abstract_context; | 5 library analyzer.test.src.context.abstract_context; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/visitor.dart'; | 9 import 'package:analyzer/dart/element/visitor.dart'; |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 AnalysisContextImpl createAnalysisContext() { | 122 AnalysisContextImpl createAnalysisContext() { |
| 123 return new AnalysisContextImpl(); | 123 return new AnalysisContextImpl(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 DartSdk createDartSdk() => new MockSdk(resourceProvider: resourceProvider); | 126 DartSdk createDartSdk() => new MockSdk(resourceProvider: resourceProvider); |
| 127 | 127 |
| 128 Source newSource(String path, [String content = '']) { | 128 Source newSource(String path, [String content = '']) { |
| 129 File file = resourceProvider.newFile(path, content); | 129 File file = |
| 130 resourceProvider.newFile(resourceProvider.convertPath(path), content); |
| 130 return file.createSource(); | 131 return file.createSource(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 List<Source> newSources(Map<String, String> sourceMap) { | 134 List<Source> newSources(Map<String, String> sourceMap) { |
| 134 List<Source> sources = <Source>[]; | 135 List<Source> sources = <Source>[]; |
| 135 sourceMap.forEach((String path, String content) { | 136 sourceMap.forEach((String path, String content) { |
| 136 Source source = newSource(path, content); | 137 Source source = newSource(path, content); |
| 137 sources.add(source); | 138 sources.add(source); |
| 138 }); | 139 }); |
| 139 return sources; | 140 return sources; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { | 181 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { |
| 181 final _ElementVisitorFunction function; | 182 final _ElementVisitorFunction function; |
| 182 | 183 |
| 183 _ElementVisitorFunctionWrapper(this.function); | 184 _ElementVisitorFunctionWrapper(this.function); |
| 184 | 185 |
| 185 visitElement(Element element) { | 186 visitElement(Element element) { |
| 186 function(element); | 187 function(element); |
| 187 super.visitElement(element); | 188 super.visitElement(element); |
| 188 } | 189 } |
| 189 } | 190 } |
| OLD | NEW |