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

Side by Side Diff: lib/src/utils.dart

Issue 971103002: Add BrowserManager and IframeTest for communicating with browser tests. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Fix errors Created 5 years, 9 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 | « lib/src/runner/browser/iframe_test.dart ('k') | no next file » | 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 library unittest.utils; 5 library unittest.utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:stack_trace/stack_trace.dart'; 9 import 'package:stack_trace/stack_trace.dart';
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (element is Iterable) { 56 if (element is Iterable) {
57 helper(element); 57 helper(element);
58 } else { 58 } else {
59 result.add(element); 59 result.add(element);
60 } 60 }
61 } 61 }
62 } 62 }
63 helper(nested); 63 helper(nested);
64 return result; 64 return result;
65 } 65 }
66
67 /// Returns a sink that maps events sent to [original] using [fn].
68 StreamSink mapSink(StreamSink original, fn(event)) {
69 var controller = new StreamController(sync: true);
70 controller.stream.listen(
71 (event) => original.add(fn(event)),
72 onError: (error, stackTrace) => original.addError(error, stackTrace),
73 onDone: () => original.close());
74 return controller.sink;
75 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/iframe_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698