Chromium Code Reviews| 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 analyzer.test.src.task.html_work_manager_test; | 5 library analyzer.test.src.task.html_work_manager_test; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart' show AnalysisError; | 7 import 'package:analyzer/error/error.dart' show AnalysisError; |
| 8 import 'package:analyzer/exception/exception.dart'; | 8 import 'package:analyzer/exception/exception.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/error/codes.dart' show HtmlErrorCode; | 10 import 'package:analyzer/src/error/codes.dart' show HtmlErrorCode; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 } | 304 } |
| 305 | 305 |
| 306 class _InternalAnalysisContextMock extends TypedMock | 306 class _InternalAnalysisContextMock extends TypedMock |
| 307 implements InternalAnalysisContext { | 307 implements InternalAnalysisContext { |
| 308 @override | 308 @override |
| 309 CachePartition privateAnalysisCachePartition; | 309 CachePartition privateAnalysisCachePartition; |
| 310 | 310 |
| 311 @override | 311 @override |
| 312 AnalysisCache analysisCache; | 312 AnalysisCache analysisCache; |
| 313 | 313 |
| 314 // the production version is a stream that carries messages from the cache | |
|
scheglov
2016/10/28 19:04:45
Write full sentences please :-)
Start with a capit
| |
| 315 // since the cache changes. Here, we can just pass the inner stream because | |
| 316 // it doesn't change | |
| 317 @override | |
| 318 get onResultInvalidated => analysisCache.onResultInvalidated; | |
| 319 | |
| 314 Map<Source, ChangeNoticeImpl> _pendingNotices = <Source, ChangeNoticeImpl>{}; | 320 Map<Source, ChangeNoticeImpl> _pendingNotices = <Source, ChangeNoticeImpl>{}; |
| 315 | 321 |
| 316 _InternalAnalysisContextMock() { | 322 _InternalAnalysisContextMock() { |
| 317 privateAnalysisCachePartition = new UniversalCachePartition(this); | 323 privateAnalysisCachePartition = new UniversalCachePartition(this); |
| 318 analysisCache = new AnalysisCache([privateAnalysisCachePartition]); | 324 analysisCache = new AnalysisCache([privateAnalysisCachePartition]); |
| 319 } | 325 } |
| 320 | 326 |
| 321 @override | 327 @override |
| 322 CacheEntry getCacheEntry(AnalysisTarget target) { | 328 CacheEntry getCacheEntry(AnalysisTarget target) { |
| 323 CacheEntry entry = analysisCache.get(target); | 329 CacheEntry entry = analysisCache.get(target); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 340 return new AnalysisErrorInfoImpl( | 346 return new AnalysisErrorInfoImpl( |
| 341 errors, getCacheEntry(source).getValue(LINE_INFO)); | 347 errors, getCacheEntry(source).getValue(LINE_INFO)); |
| 342 } | 348 } |
| 343 | 349 |
| 344 @override | 350 @override |
| 345 ChangeNoticeImpl getNotice(Source source) { | 351 ChangeNoticeImpl getNotice(Source source) { |
| 346 return _pendingNotices.putIfAbsent( | 352 return _pendingNotices.putIfAbsent( |
| 347 source, () => new ChangeNoticeImpl(source)); | 353 source, () => new ChangeNoticeImpl(source)); |
| 348 } | 354 } |
| 349 } | 355 } |
| OLD | NEW |