OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub | 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub |
6 /// tests are integration tests that stage some stuff on the file system, run | 6 /// tests are integration tests that stage some stuff on the file system, run |
7 /// pub, and then validate the results. This library provides an API to build | 7 /// pub, and then validate the results. This library provides an API to build |
8 /// tests like that. | 8 /// tests like that. |
9 library test_pub; | 9 library test_pub; |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 contents.add(packageCacheDir(name, version)); | 356 contents.add(packageCacheDir(name, version)); |
357 } | 357 } |
358 }); | 358 }); |
359 return dir(cachePath, [ | 359 return dir(cachePath, [ |
360 dir('hosted', [ | 360 dir('hosted', [ |
361 async(port.then((p) => dir('localhost%58$p', contents))) | 361 async(port.then((p) => dir('localhost%58$p', contents))) |
362 ]) | 362 ]) |
363 ]); | 363 ]); |
364 } | 364 } |
365 | 365 |
366 // TODO REMOVE | |
nweiz
2013/02/13 19:54:31
Did you mean to actually remove this method?
Bob Nystrom
2013/02/13 21:11:31
Heh, yes. :)
| |
367 /// Describes the directory in the system cache where the package [name] at | |
368 /// [version] is stored when installed from the mock package server. | |
369 Future<String> hostedCacheDir(String name, String version) { | |
370 return port.then((p) { | |
371 return path.join(cachePath, "hosted", "localhost%58$p", "$name-$version"); | |
372 }); | |
373 } | |
374 | |
366 /// Describes the file in the system cache that contains the client's OAuth2 | 375 /// Describes the file in the system cache that contains the client's OAuth2 |
367 /// credentials. The URL "/token" on [server] will be used as the token | 376 /// credentials. The URL "/token" on [server] will be used as the token |
368 /// endpoint for refreshing the access token. | 377 /// endpoint for refreshing the access token. |
369 Descriptor credentialsFile( | 378 Descriptor credentialsFile( |
370 ScheduledServer server, | 379 ScheduledServer server, |
371 String accessToken, | 380 String accessToken, |
372 {String refreshToken, | 381 {String refreshToken, |
373 DateTime expiration}) { | 382 DateTime expiration}) { |
374 return async(server.url.then((url) { | 383 return async(server.url.then((url) { |
375 return dir(cachePath, [ | 384 return dir(cachePath, [ |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1599 /// calling [completion] is unnecessary. | 1608 /// calling [completion] is unnecessary. |
1600 void expectLater(Future actual, matcher, {String reason, | 1609 void expectLater(Future actual, matcher, {String reason, |
1601 FailureHandler failureHandler, bool verbose: false}) { | 1610 FailureHandler failureHandler, bool verbose: false}) { |
1602 _schedule((_) { | 1611 _schedule((_) { |
1603 return actual.then((value) { | 1612 return actual.then((value) { |
1604 expect(value, matcher, reason: reason, failureHandler: failureHandler, | 1613 expect(value, matcher, reason: reason, failureHandler: failureHandler, |
1605 verbose: false); | 1614 verbose: false); |
1606 }); | 1615 }); |
1607 }); | 1616 }); |
1608 } | 1617 } |
OLD | NEW |