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

Side by Side Diff: lib/src/backend/live_test_controller.dart

Issue 1248073003: Add a --pause-after-load flag for debugging. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 5 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 | « CHANGELOG.md ('k') | lib/src/executable.dart » ('j') | 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) 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 test.backend.live_test_controller; 5 library test.backend.live_test_controller;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:stack_trace/stack_trace.dart'; 10 import 'package:stack_trace/stack_trace.dart';
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 /// it's not different, this does nothing. 144 /// it's not different, this does nothing.
145 void setState(State newState) { 145 void setState(State newState) {
146 if (_isClosed) return; 146 if (_isClosed) return;
147 if (_state == newState) return; 147 if (_state == newState) return;
148 148
149 _state = newState; 149 _state = newState;
150 _onStateChangeController.add(newState); 150 _onStateChangeController.add(newState);
151 } 151 }
152 152
153 /// Emits a line printed by the test over [LiveTest.onPrint]. 153 /// Emits a line printed by the test over [LiveTest.onPrint].
154 void print(String line) => _onPrintController.add(line); 154 void print(String line) {
155 if (_onPrintController.hasListener) {
kevmoo 2015/07/23 20:47:03 what's a case where the controller has no listener
nweiz 2015/07/23 21:23:00 After the test package has received a signal, it w
156 _onPrintController.add(line);
157 } else {
158 // Make sure all prints get surfaced one way or another to aid in
159 // debugging.
160 Zone.ROOT.print(line);
161 }
162 }
155 163
156 /// A wrapper for [_onRun] that ensures that it follows the guarantees for 164 /// A wrapper for [_onRun] that ensures that it follows the guarantees for
157 /// [LiveTest.run]. 165 /// [LiveTest.run].
158 Future _run() { 166 Future _run() {
159 if (_runCalled) { 167 if (_runCalled) {
160 throw new StateError("LiveTest.run() may not be called more than once."); 168 throw new StateError("LiveTest.run() may not be called more than once.");
161 } else if (_isClosed) { 169 } else if (_isClosed) {
162 throw new StateError("LiveTest.run() may not be called for a closed " 170 throw new StateError("LiveTest.run() may not be called for a closed "
163 "test."); 171 "test.");
164 } 172 }
(...skipping 12 matching lines...) Expand all
177 185
178 if (_runCalled) { 186 if (_runCalled) {
179 _onClose(); 187 _onClose();
180 } else { 188 } else {
181 completer.complete(); 189 completer.complete();
182 } 190 }
183 191
184 return completer.future; 192 return completer.future;
185 } 193 }
186 } 194 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/executable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698