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

Side by Side Diff: test/runner/load_suite_test.dart

Issue 1685363002: Add a platform plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 10 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/runner/isolate_listener_test.dart ('k') | test/utils.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 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:test/src/backend/group.dart'; 9 import 'package:test/src/backend/group.dart';
10 import 'package:test/src/backend/state.dart'; 10 import 'package:test/src/backend/state.dart';
11 import 'package:test/src/backend/test_platform.dart'; 11 import 'package:test/src/backend/test_platform.dart';
12 import 'package:test/src/runner/load_exception.dart'; 12 import 'package:test/src/runner/load_exception.dart';
13 import 'package:test/src/runner/load_suite.dart'; 13 import 'package:test/src/runner/load_suite.dart';
14 import 'package:test/src/runner/plugin/environment.dart';
14 import 'package:test/src/runner/runner_suite.dart'; 15 import 'package:test/src/runner/runner_suite.dart';
15 import 'package:test/src/runner/vm/environment.dart';
16 import 'package:test/test.dart'; 16 import 'package:test/test.dart';
17 17
18 import '../utils.dart'; 18 import '../utils.dart';
19 19
20 void main() { 20 void main() {
21 var innerSuite; 21 var innerSuite;
22 setUp(() { 22 setUp(() {
23 innerSuite = new RunnerSuite(const VMEnvironment(), new Group.root([])); 23 innerSuite = new RunnerSuite(const PluginEnvironment(), new Group.root([]));
24 }); 24 });
25 25
26 test("running a load test causes LoadSuite.suite to emit a suite", () async { 26 test("running a load test causes LoadSuite.suite to emit a suite", () async {
27 var suite = new LoadSuite("name", () => new Future.value(innerSuite)); 27 var suite = new LoadSuite("name", () => new Future.value(innerSuite));
28 expect(suite.group.entries, hasLength(1)); 28 expect(suite.group.entries, hasLength(1));
29 29
30 expect(suite.suite, completion(equals(innerSuite))); 30 expect(suite.suite, completion(equals(innerSuite)));
31 var liveTest = await suite.group.entries.single.load(suite); 31 var liveTest = await suite.group.entries.single.load(suite);
32 await liveTest.run(); 32 await liveTest.run();
33 expectTestPassed(liveTest); 33 expectTestPassed(liveTest);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 var newSuite = suite.changeSuite((suite) => suite); 118 var newSuite = suite.changeSuite((suite) => suite);
119 expect(newSuite.platform, equals(TestPlatform.vm)); 119 expect(newSuite.platform, equals(TestPlatform.vm));
120 expect(newSuite.group.entries.single.name, equals(suite.group.entries.sing le.name)); 120 expect(newSuite.group.entries.single.name, equals(suite.group.entries.sing le.name));
121 }); 121 });
122 122
123 test("changes the inner suite", () async { 123 test("changes the inner suite", () async {
124 var suite = new LoadSuite("name", () => innerSuite); 124 var suite = new LoadSuite("name", () => innerSuite);
125 expect(suite.group.entries, hasLength(1)); 125 expect(suite.group.entries, hasLength(1));
126 126
127 var newInnerSuite = new RunnerSuite( 127 var newInnerSuite = new RunnerSuite(
128 const VMEnvironment(), new Group.root([])); 128 const PluginEnvironment(), new Group.root([]));
129 var newSuite = suite.changeSuite((suite) => newInnerSuite); 129 var newSuite = suite.changeSuite((suite) => newInnerSuite);
130 expect(newSuite.suite, completion(equals(newInnerSuite))); 130 expect(newSuite.suite, completion(equals(newInnerSuite)));
131 131
132 var liveTest = await suite.group.entries.single.load(suite); 132 var liveTest = await suite.group.entries.single.load(suite);
133 await liveTest.run(); 133 await liveTest.run();
134 expectTestPassed(liveTest); 134 expectTestPassed(liveTest);
135 }); 135 });
136 136
137 test("doesn't run change() if the suite is null", () async { 137 test("doesn't run change() if the suite is null", () async {
138 var suite = new LoadSuite("name", () => null); 138 var suite = new LoadSuite("name", () => null);
(...skipping 17 matching lines...) Expand all
156 }); 156 });
157 157
158 test("forwards errors to the future", () { 158 test("forwards errors to the future", () {
159 var suite = new LoadSuite("name", () => throw "error"); 159 var suite = new LoadSuite("name", () => throw "error");
160 expect(suite.group.entries, hasLength(1)); 160 expect(suite.group.entries, hasLength(1));
161 161
162 expect(suite.getSuite(), throwsA("error")); 162 expect(suite.getSuite(), throwsA("error"));
163 }); 163 });
164 }); 164 });
165 } 165 }
OLDNEW
« no previous file with comments | « test/runner/isolate_listener_test.dart ('k') | test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698