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

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

Issue 981283003: Change all sources associated with changed files (issue 22680) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments 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) 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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 Source source = _addSource("/test.html", "<html></html>"); 1273 Source source = _addSource("/test.html", "<html></html>");
1274 expect(_context.getResolvedHtmlUnit(source), isNull); 1274 expect(_context.getResolvedHtmlUnit(source), isNull);
1275 _context.resolveHtmlUnit(source); 1275 _context.resolveHtmlUnit(source);
1276 expect(_context.getResolvedHtmlUnit(source), isNotNull); 1276 expect(_context.getResolvedHtmlUnit(source), isNotNull);
1277 } 1277 }
1278 1278
1279 void test_getSourceFactory() { 1279 void test_getSourceFactory() {
1280 expect(_context.sourceFactory, same(_sourceFactory)); 1280 expect(_context.sourceFactory, same(_sourceFactory));
1281 } 1281 }
1282 1282
1283 void test_getSourcesWithFullName() {
1284 String filePath = '/foo/lib/file.dart';
1285 List<Source> expected = <Source>[];
1286 ChangeSet changeSet = new ChangeSet();
1287
1288 TestSourceWithUri source1 =
1289 new TestSourceWithUri(filePath, Uri.parse('file://$filePath'));
1290 expected.add(source1);
1291 changeSet.addedSource(source1);
1292
1293 TestSourceWithUri source2 =
1294 new TestSourceWithUri(filePath, Uri.parse('package:foo/file.dart'));
1295 expected.add(source2);
1296 changeSet.addedSource(source2);
1297
1298 _context.applyChanges(changeSet);
1299 expect(
1300 _context.getSourcesWithFullName(filePath), unorderedEquals(expected));
1301 }
1302
1283 void test_getStatistics() { 1303 void test_getStatistics() {
1284 AnalysisContextStatistics statistics = _context.statistics; 1304 AnalysisContextStatistics statistics = _context.statistics;
1285 expect(statistics, isNotNull); 1305 expect(statistics, isNotNull);
1286 // The following lines are fragile. 1306 // The following lines are fragile.
1287 // The values depend on the number of libraries in the SDK. 1307 // The values depend on the number of libraries in the SDK.
1288 // assertLength(0, statistics.getCacheRows()); 1308 // assertLength(0, statistics.getCacheRows());
1289 // assertLength(0, statistics.getExceptions()); 1309 // assertLength(0, statistics.getExceptions());
1290 // assertLength(0, statistics.getSources()); 1310 // assertLength(0, statistics.getSources());
1291 } 1311 }
1292 1312
(...skipping 4349 matching lines...) Expand 10 before | Expand all | Expand 10 after
5642 Source unitSource, Source librarySource) { 5662 Source unitSource, Source librarySource) {
5643 fail("Unexpected invocation of getResolvedCompilationUnit"); 5663 fail("Unexpected invocation of getResolvedCompilationUnit");
5644 return null; 5664 return null;
5645 } 5665 }
5646 @override 5666 @override
5647 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) { 5667 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
5648 fail("Unexpected invocation of getResolvedHtmlUnit"); 5668 fail("Unexpected invocation of getResolvedHtmlUnit");
5649 return null; 5669 return null;
5650 } 5670 }
5651 @override 5671 @override
5672 List<Source> getSourcesWithFullName(String path) {
5673 fail("Unexpected invocation of getSourcesWithFullName");
5674 return null;
5675 }
5676 @override
5652 bool handleContentsChanged( 5677 bool handleContentsChanged(
5653 Source source, String originalContents, String newContents, bool notify) { 5678 Source source, String originalContents, String newContents, bool notify) {
5654 fail("Unexpected invocation of handleContentsChanged"); 5679 fail("Unexpected invocation of handleContentsChanged");
5655 return false; 5680 return false;
5656 } 5681 }
5657 @override 5682 @override
5658 bool isClientLibrary(Source librarySource) { 5683 bool isClientLibrary(Source librarySource) {
5659 fail("Unexpected invocation of isClientLibrary"); 5684 fail("Unexpected invocation of isClientLibrary");
5660 return false; 5685 return false;
5661 } 5686 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
5706 } 5731 }
5707 @override 5732 @override
5708 void setChangedContents(Source source, String contents, int offset, 5733 void setChangedContents(Source source, String contents, int offset,
5709 int oldLength, int newLength) { 5734 int oldLength, int newLength) {
5710 fail("Unexpected invocation of setChangedContents"); 5735 fail("Unexpected invocation of setChangedContents");
5711 } 5736 }
5712 @override 5737 @override
5713 void setContents(Source source, String contents) { 5738 void setContents(Source source, String contents) {
5714 fail("Unexpected invocation of setContents"); 5739 fail("Unexpected invocation of setContents");
5715 } 5740 }
5741
5716 @override 5742 @override
5717 void visitCacheItems(void callback(Source source, SourceEntry dartEntry, 5743 void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
5718 DataDescriptor rowDesc, CacheState state)) { 5744 DataDescriptor rowDesc, CacheState state)) {
5719 fail("Unexpected invocation of visitCacheItems"); 5745 fail("Unexpected invocation of visitCacheItems");
5720 } 5746 }
5721 } 5747 }
5722 5748
5723 class TestAnalysisContext_test_addSourceInfo extends TestAnalysisContext { 5749 class TestAnalysisContext_test_addSourceInfo extends TestAnalysisContext {
5724 bool invoked = false; 5750 bool invoked = false;
5725 TestAnalysisContext_test_addSourceInfo(); 5751 TestAnalysisContext_test_addSourceInfo();
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
6538 @override 6564 @override
6539 bool exists() => true; 6565 bool exists() => true;
6540 } 6566 }
6541 6567
6542 class _UniversalCachePartitionTest_test_setMaxCacheSize 6568 class _UniversalCachePartitionTest_test_setMaxCacheSize
6543 implements CacheRetentionPolicy { 6569 implements CacheRetentionPolicy {
6544 @override 6570 @override
6545 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) => 6571 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) =>
6546 RetentionPriority.LOW; 6572 RetentionPriority.LOW;
6547 } 6573 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698