| OLD | NEW |
| 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 library gcloud.storage; | 5 library gcloud.storage; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:gcloud/storage.dart'; | 9 import 'package:gcloud/storage.dart'; |
| 10 import 'package:googleapis/common/common.dart' as common; | 10 import 'package:googleapis/common/common.dart' as common; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 var testBucket = generateBucketName(); | 253 var testBucket = generateBucketName(); |
| 254 | 254 |
| 255 // Share the same storage connection for all tests. | 255 // Share the same storage connection for all tests. |
| 256 var storage = new Storage(httpClient, project); | 256 var storage = new Storage(httpClient, project); |
| 257 | 257 |
| 258 // Create a shared bucket for all object tests. | 258 // Create a shared bucket for all object tests. |
| 259 return storage.createBucket(testBucket).then((_) { | 259 return storage.createBucket(testBucket).then((_) { |
| 260 return runE2EUnittest(() { | 260 return runE2EUnittest(() { |
| 261 runTests(storage, storage.bucket(testBucket)); | 261 runTests(storage, storage.bucket(testBucket)); |
| 262 }).whenComplete(() { | 262 }).whenComplete(() { |
| 263 storage.deleteBucket(testBucket); | 263 // Deleting a bucket relies on eventually consistent behaviour, hence |
| 264 // the delay in attempt to prevent test flakiness. |
| 265 return new Future.delayed(STORAGE_LIST_DELAY, () { |
| 266 return storage.deleteBucket(testBucket); |
| 267 }); |
| 264 }); | 268 }); |
| 265 }); | 269 }); |
| 266 }); | 270 }); |
| 267 } | 271 } |
| OLD | NEW |