| OLD | NEW |
| 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 pub_dartlang_org.backend_test_utils; | 5 library pub_dartlang_org.backend_test_utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:gcloud/db.dart' as gdb; | 10 import 'package:gcloud/db.dart' as gdb; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 Future upload(String package, String version, Stream<List<int>> tarball) { | 187 Future upload(String package, String version, Stream<List<int>> tarball) { |
| 188 if (uploadFun == null) throw 'no uploadFun'; | 188 if (uploadFun == null) throw 'no uploadFun'; |
| 189 return uploadFun(package, version, tarball); | 189 return uploadFun(package, version, tarball); |
| 190 } | 190 } |
| 191 | 191 |
| 192 Future uploadViaTempObject( | 192 Future uploadViaTempObject( |
| 193 String guid, String package, String version) async { | 193 String guid, String package, String version) async { |
| 194 if (uploadViaTempObjectFun == null) throw 'no uploadViaTempObjectFun'; | 194 if (uploadViaTempObjectFun == null) throw 'no uploadViaTempObjectFun'; |
| 195 return uploadViaTempObjectFun(guid, package, version); | 195 return uploadViaTempObjectFun(guid, package, version); |
| 196 } | 196 } |
| 197 |
| 198 Future remove(String package, String version) => |
| 199 throw new UnimplementedError(); |
| 197 } | 200 } |
| 198 | 201 |
| 199 class UploadSignerServiceMock implements UploadSignerService { | 202 class UploadSignerServiceMock implements UploadSignerService { |
| 200 final Function buildUploadFun; | 203 final Function buildUploadFun; |
| 201 | 204 |
| 202 UploadSignerServiceMock(this.buildUploadFun); | 205 UploadSignerServiceMock(this.buildUploadFun); |
| 203 | 206 |
| 204 get serviceAccountEmail => throw 'no serviceAccountEmail support'; | 207 get serviceAccountEmail => throw 'no serviceAccountEmail support'; |
| 205 | 208 |
| 206 AsyncUploadInfo buildUpload( | 209 AsyncUploadInfo buildUpload( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 ['README.md', 'CHANGELOG.md', 'pubspec.yaml', 'lib/test_library.dart']; | 287 ['README.md', 'CHANGELOG.md', 'pubspec.yaml', 'lib/test_library.dart']; |
| 285 var args = ['cz']..addAll(files); | 288 var args = ['cz']..addAll(files); |
| 286 Process p = await Process.start('tar', args, workingDirectory: '$tmp'); | 289 Process p = await Process.start('tar', args, workingDirectory: '$tmp'); |
| 287 p.stderr.drain(); | 290 p.stderr.drain(); |
| 288 var bytes = await p.stdout.fold([], (b, d) => b..addAll(d)); | 291 var bytes = await p.stdout.fold([], (b, d) => b..addAll(d)); |
| 289 var exitCode = await p.exitCode; | 292 var exitCode = await p.exitCode; |
| 290 if (exitCode != 0) throw 'Failed to make tarball of test package.'; | 293 if (exitCode != 0) throw 'Failed to make tarball of test package.'; |
| 291 return func(bytes); | 294 return func(bytes); |
| 292 }); | 295 }); |
| 293 } | 296 } |
| OLD | NEW |