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

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

Issue 988883004: Add CacheEntry.setErrorState(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months 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 | Annotate | Revision Log
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 test.src.task.driver_test; 5 library test.src.task.driver_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/cancelable_future.dart'; 10 import 'package:analyzer/src/cancelable_future.dart';
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 WorkOrder workOrder = driver.createNextWorkOrder(); 132 WorkOrder workOrder = driver.createNextWorkOrder();
133 expect(workOrder, isNotNull); 133 expect(workOrder, isNotNull);
134 expect(workOrder.moveNext(), true); 134 expect(workOrder.moveNext(), true);
135 expect(workOrder.currentItem.target, priorityTarget); 135 expect(workOrder.currentItem.target, priorityTarget);
136 } 136 }
137 137
138 test_createWorkOrderForResult_error() { 138 test_createWorkOrderForResult_error() {
139 AnalysisTarget target = new TestSource(); 139 AnalysisTarget target = new TestSource();
140 ResultDescriptor result = new ResultDescriptor('result', null); 140 ResultDescriptor result = new ResultDescriptor('result', null);
141 context.getCacheEntry(target).setState(result, CacheState.ERROR); 141 CaughtException exception = new CaughtException(null, null);
142 context
143 .getCacheEntry(target)
144 .setErrorState(<ResultDescriptor>[result], exception);
142 145
143 expect(driver.createWorkOrderForResult(target, result), isNull); 146 expect(driver.createWorkOrderForResult(target, result), isNull);
144 } 147 }
145 148
146 test_createWorkOrderForResult_inProcess() { 149 test_createWorkOrderForResult_inProcess() {
147 AnalysisTarget target = new TestSource(); 150 AnalysisTarget target = new TestSource();
148 ResultDescriptor result = new ResultDescriptor('result', null); 151 ResultDescriptor result = new ResultDescriptor('result', null);
149 context.getCacheEntry(target).setState(result, CacheState.IN_PROCESS); 152 context.getCacheEntry(target).setState(result, CacheState.IN_PROCESS);
150 153
151 expect(driver.createWorkOrderForResult(target, result), isNull); 154 expect(driver.createWorkOrderForResult(target, result), isNull);
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 void setContents(Source source, String contents) { 781 void setContents(Source source, String contents) {
779 baseContext.setContents(source, contents); 782 baseContext.setContents(source, contents);
780 } 783 }
781 784
782 @override 785 @override
783 void visitCacheItems(void callback(Source source, SourceEntry dartEntry, 786 void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
784 DataDescriptor rowDesc, CacheState state)) { 787 DataDescriptor rowDesc, CacheState state)) {
785 baseContext.visitCacheItems(callback); 788 baseContext.visitCacheItems(callback);
786 } 789 }
787 } 790 }
OLDNEW
« pkg/analyzer/lib/src/context/cache.dart ('K') | « pkg/analyzer/test/src/context/cache_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698