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

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

Issue 1239693002: Pass actual TestPlatform and OperatingSystem values to Suite. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Update pubspec. 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 | « test/runner/browser/loader_test.dart ('k') | test/runner/loader_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 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:test/src/backend/state.dart'; 9 import 'package:test/src/backend/state.dart';
10 import 'package:test/src/backend/suite.dart'; 10 import 'package:test/src/backend/suite.dart';
11 import 'package:test/src/backend/test_platform.dart';
11 import 'package:test/src/runner/load_exception.dart'; 12 import 'package:test/src/runner/load_exception.dart';
12 import 'package:test/src/runner/load_suite.dart'; 13 import 'package:test/src/runner/load_suite.dart';
13 import 'package:test/test.dart'; 14 import 'package:test/test.dart';
14 15
15 import '../utils.dart'; 16 import '../utils.dart';
16 17
17 void main() { 18 void main() {
18 test("running a load test causes LoadSuite.suite to emit a suite", () async { 19 test("running a load test causes LoadSuite.suite to emit a suite", () async {
19 var innerSuite = new Suite([]); 20 var innerSuite = new Suite([]);
20 var suite = new LoadSuite("name", () => new Future.value(innerSuite)); 21 var suite = new LoadSuite("name", () => new Future.value(innerSuite));
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 expect(suite.suite, completion(equals(innerSuite))); 102 expect(suite.suite, completion(equals(innerSuite)));
102 var liveTest = await suite.tests.single.load(suite); 103 var liveTest = await suite.tests.single.load(suite);
103 await liveTest.run(); 104 await liveTest.run();
104 expectTestPassed(liveTest); 105 expectTestPassed(liveTest);
105 }); 106 });
106 107
107 group("changeSuite()", () { 108 group("changeSuite()", () {
108 test("returns a new load suite with the same properties", () { 109 test("returns a new load suite with the same properties", () {
109 var innerSuite = new Suite([]); 110 var innerSuite = new Suite([]);
110 var suite = new LoadSuite("name", () => innerSuite, platform: "platform"); 111 var suite = new LoadSuite("name", () => innerSuite,
112 platform: TestPlatform.vm);
111 expect(suite.tests, hasLength(1)); 113 expect(suite.tests, hasLength(1));
112 114
113 var newSuite = suite.changeSuite((suite) => suite); 115 var newSuite = suite.changeSuite((suite) => suite);
114 expect(newSuite.platform, equals("platform")); 116 expect(newSuite.platform, equals(TestPlatform.vm));
115 expect(newSuite.tests, equals(suite.tests)); 117 expect(newSuite.tests, equals(suite.tests));
116 }); 118 });
117 119
118 test("changes the inner suite", () async { 120 test("changes the inner suite", () async {
119 var innerSuite = new Suite([]); 121 var innerSuite = new Suite([]);
120 var suite = new LoadSuite("name", () => innerSuite); 122 var suite = new LoadSuite("name", () => innerSuite);
121 expect(suite.tests, hasLength(1)); 123 expect(suite.tests, hasLength(1));
122 124
123 var newInnerSuite = new Suite([]); 125 var newInnerSuite = new Suite([]);
124 var newSuite = suite.changeSuite((suite) => newInnerSuite); 126 var newSuite = suite.changeSuite((suite) => newInnerSuite);
(...skipping 27 matching lines...) Expand all
152 }); 154 });
153 155
154 test("forwards errors to the future", () { 156 test("forwards errors to the future", () {
155 var suite = new LoadSuite("name", () => throw "error"); 157 var suite = new LoadSuite("name", () => throw "error");
156 expect(suite.tests, hasLength(1)); 158 expect(suite.tests, hasLength(1));
157 159
158 expect(suite.getSuite(), throwsA("error")); 160 expect(suite.getSuite(), throwsA("error"));
159 }); 161 });
160 }); 162 });
161 } 163 }
OLDNEW
« no previous file with comments | « test/runner/browser/loader_test.dart ('k') | test/runner/loader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698