OLD | NEW |
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 of the graph segmentation algorithm used by deferred loading | 5 // Test of the graph segmentation algorithm used by deferred loading |
6 // to determine which elements can be deferred and which libraries | 6 // to determine which elements can be deferred and which libraries |
7 // much be included in the initial download (loaded eagerly). | 7 // much be included in the initial download (loaded eagerly). |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
11 import 'package:async_helper/async_helper.dart'; | 11 import 'package:async_helper/async_helper.dart'; |
12 import 'memory_compiler.dart'; | 12 import 'memory_compiler.dart'; |
13 import 'package:compiler/src/dart2jslib.dart' | 13 import 'package:compiler/src/compiler.dart' |
14 as dart2js; | 14 as dart2js; |
15 | 15 |
16 Future runTest(String mainScript, test) async { | 16 Future runTest(String mainScript, test) async { |
17 CompilationResult result = await runCompiler( | 17 CompilationResult result = await runCompiler( |
18 entryPoint: Uri.parse(mainScript), | 18 entryPoint: Uri.parse(mainScript), |
19 memorySourceFiles: MEMORY_SOURCE_FILES); | 19 memorySourceFiles: MEMORY_SOURCE_FILES); |
20 test(result.compiler); | 20 test(result.compiler); |
21 } | 21 } |
22 | 22 |
23 lookupLibrary(compiler, name) { | 23 lookupLibrary(compiler, name) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 library lib5; | 193 library lib5; |
194 | 194 |
195 foo() {} | 195 foo() {} |
196 """, | 196 """, |
197 "lib6.dart": """ | 197 "lib6.dart": """ |
198 library lib6; | 198 library lib6; |
199 | 199 |
200 foo() {} | 200 foo() {} |
201 """, | 201 """, |
202 }; | 202 }; |
OLD | NEW |