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

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

Issue 1113423003: Remove AnalysisContext.refactoringUnsafeSources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.engine_test; 8 library engine.engine_test;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 _context = AnalysisContextFactory.contextWithCore(); 1214 _context = AnalysisContextFactory.contextWithCore();
1215 _sourceFactory = _context.sourceFactory; 1215 _sourceFactory = _context.sourceFactory;
1216 Source source = _addSource("/test.dart", "class A {}"); 1216 Source source = _addSource("/test.dart", "class A {}");
1217 LibraryElement library = _context.computeLibraryElement(source); 1217 LibraryElement library = _context.computeLibraryElement(source);
1218 Namespace namespace = _context.getPublicNamespace(library); 1218 Namespace namespace = _context.getPublicNamespace(library);
1219 expect(namespace, isNotNull); 1219 expect(namespace, isNotNull);
1220 EngineTestCase.assertInstanceOf( 1220 EngineTestCase.assertInstanceOf(
1221 (obj) => obj is ClassElement, ClassElement, namespace.get("A")); 1221 (obj) => obj is ClassElement, ClassElement, namespace.get("A"));
1222 } 1222 }
1223 1223
1224 void test_getRefactoringUnsafeSources() {
1225 // not sources initially
1226 List<Source> sources = _context.refactoringUnsafeSources;
1227 expect(sources, hasLength(0));
1228 // add new source, unresolved
1229 Source source = _addSource("/test.dart", "library lib;");
1230 sources = _context.refactoringUnsafeSources;
1231 expect(sources, hasLength(1));
1232 expect(sources[0], source);
1233 // resolve source
1234 _context.computeLibraryElement(source);
1235 sources = _context.refactoringUnsafeSources;
1236 expect(sources, hasLength(0));
1237 }
1238
1239 void test_getResolvedCompilationUnit_library() { 1224 void test_getResolvedCompilationUnit_library() {
1240 _context = AnalysisContextFactory.contextWithCore(); 1225 _context = AnalysisContextFactory.contextWithCore();
1241 _sourceFactory = _context.sourceFactory; 1226 _sourceFactory = _context.sourceFactory;
1242 Source source = _addSource("/lib.dart", "library libb;"); 1227 Source source = _addSource("/lib.dart", "library libb;");
1243 LibraryElement library = _context.computeLibraryElement(source); 1228 LibraryElement library = _context.computeLibraryElement(source);
1244 expect(_context.getResolvedCompilationUnit(source, library), isNotNull); 1229 expect(_context.getResolvedCompilationUnit(source, library), isNotNull);
1245 _context.setContents(source, "library lib;"); 1230 _context.setContents(source, "library lib;");
1246 expect(_context.getResolvedCompilationUnit(source, library), isNull); 1231 expect(_context.getResolvedCompilationUnit(source, library), isNull);
1247 } 1232 }
1248 1233
(...skipping 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 @override 5483 @override
5499 List<Source> get prioritySources { 5484 List<Source> get prioritySources {
5500 fail("Unexpected invocation of getPrioritySources"); 5485 fail("Unexpected invocation of getPrioritySources");
5501 return null; 5486 return null;
5502 } 5487 }
5503 @override 5488 @override
5504 List<AnalysisTarget> get priorityTargets { 5489 List<AnalysisTarget> get priorityTargets {
5505 fail("Unexpected invocation of visitCacheItems"); 5490 fail("Unexpected invocation of visitCacheItems");
5506 return null; 5491 return null;
5507 } 5492 }
5508 @override
5509 List<Source> get refactoringUnsafeSources {
5510 fail("Unexpected invocation of getRefactoringUnsafeSources");
5511 return null;
5512 }
5513 5493
5514 @override 5494 @override
5515 ResolverVisitorFactory get resolverVisitorFactory { 5495 ResolverVisitorFactory get resolverVisitorFactory {
5516 fail("Unexpected invocation of getResolverVisitorFactory"); 5496 fail("Unexpected invocation of getResolverVisitorFactory");
5517 return null; 5497 return null;
5518 } 5498 }
5519 5499
5520 @override 5500 @override
5521 SourceFactory get sourceFactory { 5501 SourceFactory get sourceFactory {
5522 fail("Unexpected invocation of getSourceFactory"); 5502 fail("Unexpected invocation of getSourceFactory");
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
6137 class TestAnalysisContext_test_getPublicNamespace extends TestAnalysisContext { 6117 class TestAnalysisContext_test_getPublicNamespace extends TestAnalysisContext {
6138 bool invoked = false; 6118 bool invoked = false;
6139 TestAnalysisContext_test_getPublicNamespace(); 6119 TestAnalysisContext_test_getPublicNamespace();
6140 @override 6120 @override
6141 Namespace getPublicNamespace(LibraryElement library) { 6121 Namespace getPublicNamespace(LibraryElement library) {
6142 invoked = true; 6122 invoked = true;
6143 return null; 6123 return null;
6144 } 6124 }
6145 } 6125 }
6146 6126
6147 class TestAnalysisContext_test_getRefactoringUnsafeSources
6148 extends TestAnalysisContext {
6149 bool invoked = false;
6150 TestAnalysisContext_test_getRefactoringUnsafeSources();
6151 @override
6152 List<Source> get refactoringUnsafeSources {
6153 invoked = true;
6154 return null;
6155 }
6156 }
6157
6158 class TestAnalysisContext_test_getResolvedCompilationUnit_element 6127 class TestAnalysisContext_test_getResolvedCompilationUnit_element
6159 extends TestAnalysisContext { 6128 extends TestAnalysisContext {
6160 bool invoked = false; 6129 bool invoked = false;
6161 TestAnalysisContext_test_getResolvedCompilationUnit_element(); 6130 TestAnalysisContext_test_getResolvedCompilationUnit_element();
6162 @override 6131 @override
6163 CompilationUnit getResolvedCompilationUnit( 6132 CompilationUnit getResolvedCompilationUnit(
6164 Source unitSource, LibraryElement library) { 6133 Source unitSource, LibraryElement library) {
6165 invoked = true; 6134 invoked = true;
6166 return null; 6135 return null;
6167 } 6136 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
6631 @override 6600 @override
6632 bool exists() => true; 6601 bool exists() => true;
6633 } 6602 }
6634 6603
6635 class _UniversalCachePartitionTest_test_setMaxCacheSize 6604 class _UniversalCachePartitionTest_test_setMaxCacheSize
6636 implements CacheRetentionPolicy { 6605 implements CacheRetentionPolicy {
6637 @override 6606 @override
6638 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) => 6607 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) =>
6639 RetentionPriority.LOW; 6608 RetentionPriority.LOW;
6640 } 6609 }
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