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

Side by Side Diff: tests/compiler/dart2js/in_user_code_test.dart

Issue 2939063002: Strong mode cleaning of many dart2js tests. (Closed)
Patch Set: Use ClassElement. Created 3 years, 6 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // Test that the helper [Compiler.inUserCode] works as intended. 5 // Test that the helper [Compiler.inUserCode] works as intended.
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
(...skipping 30 matching lines...) Expand all
41 }; 41 };
42 42
43 Future test(List<Uri> entryPoints, Map<String, bool> expectedResults) async { 43 Future test(List<Uri> entryPoints, Map<String, bool> expectedResults) async {
44 CompilationResult result = await runCompiler( 44 CompilationResult result = await runCompiler(
45 entryPoints: entryPoints, 45 entryPoints: entryPoints,
46 memorySourceFiles: SOURCE, 46 memorySourceFiles: SOURCE,
47 options: [Flags.analyzeOnly, Flags.analyzeAll], 47 options: [Flags.analyzeOnly, Flags.analyzeAll],
48 packageRoot: Uri.parse('memory:pkg/')); 48 packageRoot: Uri.parse('memory:pkg/'));
49 Compiler compiler = result.compiler; 49 Compiler compiler = result.compiler;
50 expectedResults.forEach((String uri, bool expectedResult) { 50 expectedResults.forEach((String uri, bool expectedResult) {
51 var element = compiler.libraryLoader.lookupLibrary(Uri.parse(uri)); 51 dynamic element = compiler.libraryLoader.lookupLibrary(Uri.parse(uri));
52 Expect.isNotNull(element, "Unknown library '$uri'."); 52 Expect.isNotNull(element, "Unknown library '$uri'.");
53 Expect.equals( 53 Expect.equals(
54 expectedResult, 54 expectedResult,
55 compiler.inUserCode(element), 55 compiler.inUserCode(element),
56 expectedResult 56 expectedResult
57 ? "Library '$uri' expected to be in user code" 57 ? "Library '$uri' expected to be in user code"
58 : "Library '$uri' not expected to be in user code"); 58 : "Library '$uri' not expected to be in user code");
59 }); 59 });
60 } 60 }
61 61
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Uri.parse('dart:async'), 100 Uri.parse('dart:async'),
101 Uri.parse('package:sub/bar.dart') 101 Uri.parse('package:sub/bar.dart')
102 ], { 102 ], {
103 'package:sub/bar.dart': true, 103 'package:sub/bar.dart': true,
104 'package:sub/baz.dart': true, 104 'package:sub/baz.dart': true,
105 'package:sup/boz.dart': false, 105 'package:sup/boz.dart': false,
106 'dart:core': true, 106 'dart:core': true,
107 'dart:async': true 107 'dart:async': true
108 }); 108 });
109 } 109 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698