| 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 test.src.task.dart_test; | 5 library test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 import 'b.dart'; | 1106 import 'b.dart'; |
| 1107 '''); | 1107 '''); |
| 1108 _newSource('/b.dart', ''' | 1108 _newSource('/b.dart', ''' |
| 1109 library lib_b; | 1109 library lib_b; |
| 1110 '''); | 1110 '''); |
| 1111 _computeResult(sourceA, IS_CLIENT); | 1111 _computeResult(sourceA, IS_CLIENT); |
| 1112 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); | 1112 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); |
| 1113 expect(outputs[IS_CLIENT], isFalse); | 1113 expect(outputs[IS_CLIENT], isFalse); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 test_perform_isClient_true_direct() { | 1116 test_perform_isClient_true_export_indirect() { |
| 1117 _newSource('/exports_html.dart', ''' |
| 1118 library lib_exports_html; |
| 1119 export 'dart:html'; |
| 1120 '''); |
| 1121 Source source = _newSource('/test.dart', ''' |
| 1122 import 'exports_html.dart'; |
| 1123 '''); |
| 1124 _computeResult(source, IS_CLIENT); |
| 1125 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); |
| 1126 expect(outputs[IS_CLIENT], isTrue); |
| 1127 } |
| 1128 |
| 1129 test_perform_isClient_true_import_direct() { |
| 1117 Source sourceA = _newSource('/a.dart', ''' | 1130 Source sourceA = _newSource('/a.dart', ''' |
| 1118 library lib_a; | 1131 library lib_a; |
| 1119 import 'dart:html'; | 1132 import 'dart:html'; |
| 1120 '''); | 1133 '''); |
| 1121 _computeResult(sourceA, IS_CLIENT); | 1134 _computeResult(sourceA, IS_CLIENT); |
| 1122 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); | 1135 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); |
| 1123 expect(outputs[IS_CLIENT], isTrue); | 1136 expect(outputs[IS_CLIENT], isTrue); |
| 1124 } | 1137 } |
| 1125 | 1138 |
| 1126 test_perform_isClient_true_indirect() { | 1139 test_perform_isClient_true_import_indirect() { |
| 1127 Source sourceA = _newSource('/a.dart', ''' | 1140 Source sourceA = _newSource('/a.dart', ''' |
| 1128 library lib_a; | 1141 library lib_a; |
| 1129 import 'b.dart'; | 1142 import 'b.dart'; |
| 1130 '''); | 1143 '''); |
| 1131 _newSource('/b.dart', ''' | 1144 _newSource('/b.dart', ''' |
| 1132 library lib_b; | 1145 library lib_b; |
| 1133 import 'dart:html'; | 1146 import 'dart:html'; |
| 1134 '''); | 1147 '''); |
| 1135 _computeResult(sourceA, IS_CLIENT); | 1148 _computeResult(sourceA, IS_CLIENT); |
| 1136 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); | 1149 expect(task, new isInstanceOf<BuildSourceClosuresTask>()); |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 return entryMap.putIfAbsent(target, () => new CacheEntry()); | 1926 return entryMap.putIfAbsent(target, () => new CacheEntry()); |
| 1914 } | 1927 } |
| 1915 | 1928 |
| 1916 TimestampedData<String> getContents(Source source) => source.contents; | 1929 TimestampedData<String> getContents(Source source) => source.contents; |
| 1917 | 1930 |
| 1918 noSuchMethod(Invocation invocation) { | 1931 noSuchMethod(Invocation invocation) { |
| 1919 print('noSuchMethod: ${invocation.memberName}'); | 1932 print('noSuchMethod: ${invocation.memberName}'); |
| 1920 return super.noSuchMethod(invocation); | 1933 return super.noSuchMethod(invocation); |
| 1921 } | 1934 } |
| 1922 } | 1935 } |
| OLD | NEW |