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

Unified Diff: pkg/analyzer/test/src/task/model_test.dart

Issue 1133513003: Cache flushing implementation for the task model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/context/context_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/model_test.dart
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index 5fd31ec70250b27e6fd7ffc6839a006a0d9507d6..9a402a291d9fc3117a1a0eeee0e1ecc4aade5e81 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -19,6 +19,7 @@ main() {
runReflectiveTests(AnalysisTaskTest);
runReflectiveTests(ContributionPointImplTest);
runReflectiveTests(ResultDescriptorImplTest);
+ runReflectiveTests(SimpleResultCachingPolicyTest);
runReflectiveTests(TaskDescriptorImplTest);
}
@@ -94,6 +95,13 @@ class ContributionPointImplTest extends EngineTestCase {
@reflectiveTest
class ResultDescriptorImplTest extends EngineTestCase {
+ test_create_withCachingPolicy() {
+ ResultCachingPolicy policy = new SimpleResultCachingPolicy(128, 16);
+ ResultDescriptorImpl result =
+ new ResultDescriptorImpl('result', null, cachingPolicy: policy);
+ expect(result.cachingPolicy, same(policy));
+ }
+
test_create_withContribution() {
CompositeResultDescriptorImpl point =
new CompositeResultDescriptorImpl('point');
@@ -104,6 +112,14 @@ class ResultDescriptorImplTest extends EngineTestCase {
expect(contributors, unorderedEquals([result]));
}
+ test_create_withoutCachingPolicy() {
+ ResultDescriptorImpl result = new ResultDescriptorImpl('result', null);
+ ResultCachingPolicy cachingPolicy = result.cachingPolicy;
+ expect(cachingPolicy, isNotNull);
+ expect(cachingPolicy.maxActiveSize, -1);
+ expect(cachingPolicy.maxIdleSize, -1);
+ }
+
test_create_withoutContribution() {
expect(new ResultDescriptorImpl('name', null), isNotNull);
}
@@ -123,6 +139,16 @@ class ResultDescriptorImplTest extends EngineTestCase {
}
@reflectiveTest
+class SimpleResultCachingPolicyTest extends EngineTestCase {
+ test_create() {
+ ResultCachingPolicy policy = new SimpleResultCachingPolicy(256, 32);
+ expect(policy.maxActiveSize, 256);
+ expect(policy.maxIdleSize, 32);
+ expect(policy.measure(null), 1);
+ }
+}
+
+@reflectiveTest
class TaskDescriptorImplTest extends EngineTestCase {
test_create() {
String name = 'name';
« no previous file with comments | « pkg/analyzer/test/src/context/context_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698