Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 library descriptor_test; | 5 library descriptor_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:pathos/path.dart' as path; | 10 import 'package:pathos/path.dart' as path; |
| 11 import 'package:scheduled_test/descriptor.dart' as d; | 11 import 'package:scheduled_test/descriptor.dart' as d; |
| 12 import 'package:scheduled_test/scheduled_test.dart'; | 12 import 'package:scheduled_test/scheduled_test.dart'; |
| 13 | 13 |
| 14 import 'metatest.dart'; | 14 import 'metatest.dart'; |
| 15 import 'utils.dart'; | 15 import 'utils.dart'; |
| 16 | 16 |
| 17 String sandbox; | 17 String sandbox; |
| 18 | 18 |
| 19 void main() { | 19 void main() { |
| 20 metaSetUp(() { | |
| 21 // The windows bots are very slow, so we increase the default timeout. | |
| 22 if (Platform.operatingSystem != "windows") return; | |
| 23 currentSchedule.timeout = new Duration(seconds: 10); | |
|
Bob Nystrom
2013/03/29 21:08:31
How about applying a multiplier to the previous ti
nweiz
2013/03/29 21:38:32
In this case, we are the user.
| |
| 24 }); | |
| 25 | |
| 20 expectTestsPass('file().create() creates a file', () { | 26 expectTestsPass('file().create() creates a file', () { |
| 21 test('test', () { | 27 test('test', () { |
| 22 scheduleSandbox(); | 28 scheduleSandbox(); |
| 23 | 29 |
| 24 d.file('name.txt', 'contents').create(); | 30 d.file('name.txt', 'contents').create(); |
| 25 | 31 |
| 26 schedule(() { | 32 schedule(() { |
| 27 expect(new File(path.join(sandbox, 'name.txt')).readAsString(), | 33 expect(new File(path.join(sandbox, 'name.txt')).readAsString(), |
| 28 completion(equals('contents'))); | 34 completion(equals('contents'))); |
| 29 }); | 35 }); |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 964 | 970 |
| 965 Future<List<int>> byteStreamToList(Stream<List<int>> stream) { | 971 Future<List<int>> byteStreamToList(Stream<List<int>> stream) { |
| 966 return stream.reduce(<int>[], (buffer, chunk) { | 972 return stream.reduce(<int>[], (buffer, chunk) { |
| 967 buffer.addAll(chunk); | 973 buffer.addAll(chunk); |
| 968 return buffer; | 974 return buffer; |
| 969 }); | 975 }); |
| 970 } | 976 } |
| 971 | 977 |
| 972 Future<String> byteStreamToString(Stream<List<int>> stream) => | 978 Future<String> byteStreamToString(Stream<List<int>> stream) => |
| 973 byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes)); | 979 byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes)); |
| OLD | NEW |