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

Side by Side Diff: pkg/analyzer/test/src/task/html_work_manager_test.dart

Issue 2454233003: Ensure HtmlWorkManager is subscribed to the right stream for invalidations in the presence of Sourc… (Closed)
Patch Set: Created 4 years, 1 month 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698