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: test/runner/browser/runner_test.dart

Issue 1400743002: Add support for setUpAll and tearDownAll. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 2 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 | « test/frontend/tear_down_all_test.dart ('k') | test/runner/engine_test.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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'package:scheduled_test/descriptor.dart' as d; 7 import 'package:scheduled_test/descriptor.dart' as d;
8 import 'package:scheduled_test/scheduled_stream.dart'; 8 import 'package:scheduled_test/scheduled_stream.dart';
9 import 'package:scheduled_test/scheduled_test.dart'; 9 import 'package:scheduled_test/scheduled_test.dart';
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 }); 204 });
205 205
206 test("on a browser and the VM", () { 206 test("on a browser and the VM", () {
207 d.file("test.dart", _success).create(); 207 d.file("test.dart", _success).create();
208 var test = runTest(["-p", "content-shell", "-p", "vm", "test.dart"]); 208 var test = runTest(["-p", "content-shell", "-p", "vm", "test.dart"]);
209 209
210 test.stdout.expect(consumeThrough(contains("+2: All tests passed!"))); 210 test.stdout.expect(consumeThrough(contains("+2: All tests passed!")));
211 test.shouldExit(0); 211 test.shouldExit(0);
212 }); 212 });
213 213
214 test("with setUpAll", () {
215 d.file("test.dart", r"""
216 import 'package:test/test.dart';
217
218 void main() {
219 setUpAll(() => print("in setUpAll"));
220
221 test("test", () {});
222 }
223 """).create();
224
225 var test = runTest(["-p", "content-shell", "test.dart"]);
226 test.stdout.expect(consumeThrough(contains('+0: (setUpAll)')));
227 test.stdout.expect('in setUpAll');
228 test.shouldExit(0);
229 });
230
231 test("with tearDownAll", () {
232 d.file("test.dart", r"""
233 import 'package:test/test.dart';
234
235 void main() {
236 tearDownAll(() => print("in tearDownAll"));
237
238 test("test", () {});
239 }
240 """).create();
241
242 var test = runTest(["-p", "content-shell", "test.dart"]);
243 test.stdout.expect(consumeThrough(contains('+1: (tearDownAll)')));
244 test.stdout.expect('in tearDownAll');
245 test.shouldExit(0);
246 });
247
214 // Regression test; this broke in 0.12.0-beta.9. 248 // Regression test; this broke in 0.12.0-beta.9.
215 test("on a file in a subdirectory", () { 249 test("on a file in a subdirectory", () {
216 d.dir("dir", [d.file("test.dart", _success)]).create(); 250 d.dir("dir", [d.file("test.dart", _success)]).create();
217 251
218 var test = runTest(["-p", "chrome", "dir/test.dart"]); 252 var test = runTest(["-p", "chrome", "dir/test.dart"]);
219 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); 253 test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
220 test.shouldExit(0); 254 test.shouldExit(0);
221 }); 255 });
222 256
223 group("with a custom HTML file", () { 257 group("with a custom HTML file", () {
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 test("success", () {}); 644 test("success", () {});
611 } 645 }
612 ''').create(); 646 ''').create();
613 647
614 var test = runTest(["-p", "content-shell", "test.dart"]); 648 var test = runTest(["-p", "content-shell", "test.dart"]);
615 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); 649 test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
616 test.shouldExit(0); 650 test.shouldExit(0);
617 }); 651 });
618 }); 652 });
619 } 653 }
OLDNEW
« no previous file with comments | « test/frontend/tear_down_all_test.dart ('k') | test/runner/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698