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

Side by Side Diff: pkg/analyzer/test/generated/engine_test.dart

Issue 1403033002: State-carrying context API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes and tests. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.engine_test; 5 library engine.engine_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/file_system/memory_file_system.dart'; 10 import 'package:analyzer/file_system/memory_file_system.dart';
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 completed = true; 858 completed = true;
859 }); 859 });
860 return pumpEventQueue().then((_) { 860 return pumpEventQueue().then((_) {
861 expect(completed, isFalse); 861 expect(completed, isFalse);
862 _performPendingAnalysisTasks(); 862 _performPendingAnalysisTasks();
863 }).then((_) => pumpEventQueue()).then((_) { 863 }).then((_) => pumpEventQueue()).then((_) {
864 expect(completed, isTrue); 864 expect(completed, isTrue);
865 }); 865 });
866 } 866 }
867 867
868 void test_configurationData() {
869 var key = new newContext.ResultDescriptor('test_key', '');
870 var testData = ['test', 'data'];
871 _context.setConfigurationData(key, testData);
872 expect(_context.getConfigurationData(key), testData);
873 var unusedKey = new newContext.ResultDescriptor('unused_key', '');
874 expect(_context.getConfigurationData(unusedKey), null);
875 }
876
868 void test_dispose() { 877 void test_dispose() {
869 expect(_context.isDisposed, isFalse); 878 expect(_context.isDisposed, isFalse);
870 _context.dispose(); 879 _context.dispose();
871 expect(_context.isDisposed, isTrue); 880 expect(_context.isDisposed, isTrue);
872 } 881 }
873 882
874 void test_exists_false() { 883 void test_exists_false() {
875 TestSource source = new TestSource(); 884 TestSource source = new TestSource();
876 source.exists2 = false; 885 source.exists2 = false;
877 expect(_context.exists(source), isFalse); 886 expect(_context.exists(source), isFalse);
(...skipping 5064 matching lines...) Expand 10 before | Expand all | Expand 10 after
5942 } 5951 }
5943 5952
5944 @override 5953 @override
5945 CompilationUnitElement getCompilationUnitElement( 5954 CompilationUnitElement getCompilationUnitElement(
5946 Source unitSource, Source librarySource) { 5955 Source unitSource, Source librarySource) {
5947 fail("Unexpected invocation of getCompilationUnitElement"); 5956 fail("Unexpected invocation of getCompilationUnitElement");
5948 return null; 5957 return null;
5949 } 5958 }
5950 5959
5951 @override 5960 @override
5961 Object getConfigurationData(newContext.ResultDescriptor key) {
5962 fail("Unexpected invocation of getConfigurationData");
5963 }
5964
5965 @override
5952 TimestampedData<String> getContents(Source source) { 5966 TimestampedData<String> getContents(Source source) {
5953 fail("Unexpected invocation of getContents"); 5967 fail("Unexpected invocation of getContents");
5954 return null; 5968 return null;
5955 } 5969 }
5956 5970
5957 @override 5971 @override
5958 InternalAnalysisContext getContextFor(Source source) { 5972 InternalAnalysisContext getContextFor(Source source) {
5959 fail("Unexpected invocation of getContextFor"); 5973 fail("Unexpected invocation of getContextFor");
5960 return null; 5974 return null;
5961 } 5975 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
6159 return null; 6173 return null;
6160 } 6174 }
6161 6175
6162 @override 6176 @override
6163 void setChangedContents(Source source, String contents, int offset, 6177 void setChangedContents(Source source, String contents, int offset,
6164 int oldLength, int newLength) { 6178 int oldLength, int newLength) {
6165 fail("Unexpected invocation of setChangedContents"); 6179 fail("Unexpected invocation of setChangedContents");
6166 } 6180 }
6167 6181
6168 @override 6182 @override
6183 void setConfigurationData(newContext.ResultDescriptor key, Object data) {
6184 fail("Unexpected invocation of setConfigurationData");
6185 }
6186
6187 @override
6169 void setContents(Source source, String contents) { 6188 void setContents(Source source, String contents) {
6170 fail("Unexpected invocation of setContents"); 6189 fail("Unexpected invocation of setContents");
6171 } 6190 }
6172 6191
6173 @override 6192 @override
6174 bool shouldErrorsBeAnalyzed(Source source, Object entry) { 6193 bool shouldErrorsBeAnalyzed(Source source, Object entry) {
6175 fail("Unexpected invocation of shouldErrorsBeAnalyzed"); 6194 fail("Unexpected invocation of shouldErrorsBeAnalyzed");
6176 return false; 6195 return false;
6177 } 6196 }
6178 6197
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
7020 @override 7039 @override
7021 bool exists() => true; 7040 bool exists() => true;
7022 } 7041 }
7023 7042
7024 class _UniversalCachePartitionTest_test_setMaxCacheSize 7043 class _UniversalCachePartitionTest_test_setMaxCacheSize
7025 implements CacheRetentionPolicy { 7044 implements CacheRetentionPolicy {
7026 @override 7045 @override
7027 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) => 7046 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) =>
7028 RetentionPriority.LOW; 7047 RetentionPriority.LOW;
7029 } 7048 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698