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

Unified Diff: tests/compiler/dart2js/source_mapping_test.dart

Issue 925943002: Refactor SourceFile, SourceFileProvider and SourceLocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/parser_helper.dart ('k') | tests/compiler/dart2js/type_checker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/source_mapping_test.dart
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index 8b5fa4e2ca24fe93a4b2e15a5627594ff417ae0e..77ab4d0103d34b38bedcb70b201e64a286e3a563 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -30,11 +30,12 @@ void testSourceMapLocations(String codeWithMarkers) {
}
String code = codeWithMarkers.replaceAll('@', '');
- SourceFile sourceFile = new StringSourceFile('<test script>', code);
+ SourceFile sourceFile = new StringSourceFile.fromName('<test script>', code);
asyncTest(() => compileAll(sourceFile).then((CodeOutput output) {
Set<int> locations = new Set<int>();
output.forEachSourceLocation((int offset, var sourcePosition) {
- if (sourcePosition != null && sourcePosition.sourceFile == sourceFile) {
+ if (sourcePosition != null &&
+ sourcePosition.sourceUri == sourceFile.uri) {
locations.add(sourcePosition.token.charOffset);
}
});
@@ -44,7 +45,7 @@ void testSourceMapLocations(String codeWithMarkers) {
if (!locations.contains(expectedLocation)) {
int originalLocation = expectedLocation + i;
SourceFile sourceFileWithMarkers =
- new StringSourceFile('<test script>', codeWithMarkers);
+ new StringSourceFile.fromName('<test script>', codeWithMarkers);
String message = sourceFileWithMarkers.getLocationMessage(
'Missing location', originalLocation, originalLocation + 1);
Expect.fail(message);
« no previous file with comments | « tests/compiler/dart2js/parser_helper.dart ('k') | tests/compiler/dart2js/type_checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698