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

Side by Side Diff: pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart

Issue 1470793002: Don't run 'pub list-package-dirs' if there is no pubpsec.lock file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/source/pub_package_map_provider.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.source.caching_pub_package_map_provider; 5 library test.source.caching_pub_package_map_provider;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 Folder newProj(Map result) { 43 Folder newProj(Map result) {
44 Map packages = result['packages']; 44 Map packages = result['packages'];
45 packages.forEach((String name, String path) { 45 packages.forEach((String name, String path) {
46 resProvider.newFolder(path); 46 resProvider.newFolder(path);
47 }); 47 });
48 List<String> inputFiles = result['input_files']; 48 List<String> inputFiles = result['input_files'];
49 for (String path in inputFiles) { 49 for (String path in inputFiles) {
50 resProvider.newFile(path, ''); 50 resProvider.newFile(path, '');
51 } 51 }
52 return resProvider.getResource(inputFiles[0]).parent; 52 Folder projectFolder = resProvider.getResource(inputFiles[0]).parent;
53 resProvider.newFile(projectFolder.path + '/pubspec.lock', '');
54 return projectFolder;
53 } 55 }
54 56
55 int mockWriteFile(File cacheFile, String content) { 57 int mockWriteFile(File cacheFile, String content) {
56 if (writeFileException) { 58 if (writeFileException) {
57 throw 'simulated write failure: $cacheFile'; 59 throw 'simulated write failure: $cacheFile';
58 } 60 }
59 if (!cacheFile.exists) { 61 if (!cacheFile.exists) {
60 resProvider.newFolder(cacheFile.parent.path); 62 resProvider.newFolder(cacheFile.parent.path);
61 resProvider.newFile(cacheFile.path, content); 63 resProvider.newFile(cacheFile.path, content);
62 } else { 64 } else {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 provider.newFolder(path); 393 provider.newFolder(path);
392 } 394 }
393 int fileCount = _filePaths.length; 395 int fileCount = _filePaths.length;
394 for (int fileIndex = 0; fileIndex < fileCount; ++fileIndex) { 396 for (int fileIndex = 0; fileIndex < fileCount; ++fileIndex) {
395 String path = _filePaths[fileIndex]; 397 String path = _filePaths[fileIndex];
396 TimestampedData content = _fileContents[fileIndex]; 398 TimestampedData content = _fileContents[fileIndex];
397 provider.newFile(path, content.data, content.modificationTime); 399 provider.newFile(path, content.data, content.modificationTime);
398 } 400 }
399 } 401 }
400 } 402 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/source/pub_package_map_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698