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

Side by Side Diff: test/descriptor.dart

Issue 1664563002: Refactor test servers to make them less global. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 10 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
« no previous file with comments | « test/cache/repair/reinstalls_hosted_packages_test.dart ('k') | test/descriptor_server.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Pub-specific scheduled_test descriptors. 5 /// Pub-specific scheduled_test descriptors.
6 import 'package:oauth2/oauth2.dart' as oauth2; 6 import 'package:oauth2/oauth2.dart' as oauth2;
7 import 'package:pub/src/io.dart'; 7 import 'package:pub/src/io.dart';
8 import 'package:pub/src/utils.dart'; 8 import 'package:pub/src/utils.dart';
9 import 'package:scheduled_test/descriptor.dart'; 9 import 'package:scheduled_test/descriptor.dart';
10 import 'package:scheduled_test/scheduled_server.dart'; 10 import 'package:scheduled_test/scheduled_server.dart';
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 }); 146 });
147 147
148 return hostedCache(contents); 148 return hostedCache(contents);
149 } 149 }
150 150
151 /// Describes the main cache directory containing cached hosted packages 151 /// Describes the main cache directory containing cached hosted packages
152 /// downloaded from the mock package server. 152 /// downloaded from the mock package server.
153 Descriptor hostedCache(Iterable<Descriptor> contents) { 153 Descriptor hostedCache(Iterable<Descriptor> contents) {
154 return dir(cachePath, [ 154 return dir(cachePath, [
155 dir('hosted', [ 155 dir('hosted', [
156 async(port.then((p) => dir('localhost%58$p', contents))) 156 async(globalServer.port.then((p) => dir('localhost%58$p', contents)))
157 ]) 157 ])
158 ]); 158 ]);
159 } 159 }
160 160
161 /// Describes the file in the system cache that contains the client's OAuth2 161 /// Describes the file in the system cache that contains the client's OAuth2
162 /// credentials. The URL "/token" on [server] will be used as the token 162 /// credentials. The URL "/token" on [server] will be used as the token
163 /// endpoint for refreshing the access token. 163 /// endpoint for refreshing the access token.
164 Descriptor credentialsFile( 164 Descriptor credentialsFile(
165 ScheduledServer server, 165 ScheduledServer server,
166 String accessToken, 166 String accessToken,
(...skipping 22 matching lines...) Expand all
189 /// are located on disk. If the strings are semantic versions, then the packages 189 /// are located on disk. If the strings are semantic versions, then the packages
190 /// are located in the system cache; otherwise, the strings are interpreted as 190 /// are located in the system cache; otherwise, the strings are interpreted as
191 /// relative `file:` URLs. 191 /// relative `file:` URLs.
192 /// 192 ///
193 /// Validation checks that the `.packages` file exists, has the expected 193 /// Validation checks that the `.packages` file exists, has the expected
194 /// entries (one per key in [dependencies]), each with a path that contains 194 /// entries (one per key in [dependencies]), each with a path that contains
195 /// either the version string (for a reference to the pub cache) or a 195 /// either the version string (for a reference to the pub cache) or a
196 /// path to a path dependency, relative to the application directory. 196 /// path to a path dependency, relative to the application directory.
197 Descriptor packagesFile([Map dependencies]) => 197 Descriptor packagesFile([Map dependencies]) =>
198 new PackagesFileDescriptor(dependencies); 198 new PackagesFileDescriptor(dependencies);
OLDNEW
« no previous file with comments | « test/cache/repair/reinstalls_hosted_packages_test.dart ('k') | test/descriptor_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698