| 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 dev_compiler.test.dependency_graph_test; | 5 library dev_compiler.test.dependency_graph_test; |
| 6 | 6 |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 | 8 |
| 9 import 'package:dev_compiler/src/checker/dart_sdk.dart' | 9 import 'package:dev_compiler/src/checker/dart_sdk.dart' |
| 10 show mockSdkSources, dartSdkDirectory; | 10 show mockSdkSources, dartSdkDirectory; |
| 11 import 'package:dev_compiler/src/testing.dart'; | 11 import 'package:dev_compiler/src/testing.dart'; |
| 12 import 'package:dev_compiler/src/options.dart'; | 12 import 'package:dev_compiler/src/options.dart'; |
| 13 import 'package:dev_compiler/src/checker/resolver.dart'; | 13 import 'package:dev_compiler/src/checker/resolver.dart'; |
| 14 import 'package:dev_compiler/src/dependency_graph.dart'; | 14 import 'package:dev_compiler/src/dependency_graph.dart'; |
| 15 import 'package:dev_compiler/src/report.dart'; | 15 import 'package:dev_compiler/src/report.dart'; |
| 16 import 'package:path/path.dart' as path; | 16 import 'package:path/path.dart' as path; |
| 17 | 17 |
| 18 import 'test_util.dart'; | 18 import 'test_util.dart'; |
| 19 | 19 |
| 20 void main() { | 20 void main() { |
| 21 configureTest(); | 21 configureTest(); |
| 22 | 22 |
| 23 var options = new CompilerOptions(); | 23 var options = new CompilerOptions(runtimeDir: '/dev_compiler_runtime/'); |
| 24 var testUriResolver; | 24 var testUriResolver; |
| 25 var context; | 25 var context; |
| 26 var graph; | 26 var graph; |
| 27 | 27 |
| 28 /// Initial values for test files | 28 /// Initial values for test files |
| 29 var testFiles = { | 29 var testFiles = { |
| 30 '/index1.html': ''' | 30 '/index1.html': ''' |
| 31 <script src="foo.js"></script> | 31 <script src="foo.js"></script> |
| 32 ''', | 32 ''', |
| 33 '/index2.html': ''' | 33 '/index2.html': ''' |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | |-- a6.dart (part) | 659 | |-- a6.dart (part) |
| 660 |-- harmony_feature_check.js | 660 |-- harmony_feature_check.js |
| 661 |-- dart_runtime.js | 661 |-- dart_runtime.js |
| 662 |-- dart_core.js | 662 |-- dart_core.js |
| 663 '''); | 663 '''); |
| 664 }); | 664 }); |
| 665 }); | 665 }); |
| 666 | 666 |
| 667 group('server-mode', () { | 667 group('server-mode', () { |
| 668 setUp(() { | 668 setUp(() { |
| 669 var options2 = new CompilerOptions(serverMode: true); | 669 var options2 = new CompilerOptions( |
| 670 runtimeDir: '/dev_compiler_runtime/', serverMode: true); |
| 670 context = new TypeResolver.fromMock(mockSdkSources, options2, | 671 context = new TypeResolver.fromMock(mockSdkSources, options2, |
| 671 otherResolvers: [testUriResolver]).context; | 672 otherResolvers: [testUriResolver]).context; |
| 672 graph = new SourceGraph(context, new LogReporter(), options2); | 673 graph = new SourceGraph(context, new LogReporter(), options2); |
| 673 }); | 674 }); |
| 674 | 675 |
| 675 test('messages widget is automatically included', () { | 676 test('messages widget is automatically included', () { |
| 676 var node = nodeOf('/index3.html'); | 677 var node = nodeOf('/index3.html'); |
| 677 expectGraph(node, ''' | 678 expectGraph(node, ''' |
| 678 index3.html | 679 index3.html |
| 679 |-- harmony_feature_check.js | 680 |-- harmony_feature_check.js |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 ..write(e.structureChanged ? '[structure-changed] ' : ' ') | 1235 ..write(e.structureChanged ? '[structure-changed] ' : ' ') |
| 1235 ..write('\n'); | 1236 ..write('\n'); |
| 1236 }); | 1237 }); |
| 1237 } | 1238 } |
| 1238 } | 1239 } |
| 1239 helper(node); | 1240 helper(node); |
| 1240 return sb.toString(); | 1241 return sb.toString(); |
| 1241 } | 1242 } |
| 1242 | 1243 |
| 1243 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b); | 1244 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b); |
| OLD | NEW |