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

Side by Side Diff: lib/src/runner/browser/browser_manager.dart

Issue 1258163002: Split out a RunnerSuite class. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 4 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
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.runner.browser.browser_manager; 5 library test.runner.browser.browser_manager;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:http_parser/http_parser.dart'; 10 import 'package:http_parser/http_parser.dart';
11 import 'package:pool/pool.dart'; 11 import 'package:pool/pool.dart';
12 12
13 import '../../backend/metadata.dart'; 13 import '../../backend/metadata.dart';
14 import '../../backend/suite.dart';
kevmoo 2015/07/28 01:48:00 loadSuite still refers to Suite in the future retu
nweiz 2015/07/28 20:01:21 Done.
15 import '../../backend/test_platform.dart'; 14 import '../../backend/test_platform.dart';
16 import '../../util/multi_channel.dart'; 15 import '../../util/multi_channel.dart';
17 import '../../util/remote_exception.dart'; 16 import '../../util/remote_exception.dart';
18 import '../../util/stack_trace_mapper.dart'; 17 import '../../util/stack_trace_mapper.dart';
19 import '../../utils.dart'; 18 import '../../utils.dart';
20 import '../load_exception.dart'; 19 import '../load_exception.dart';
20 import '../runner_suite.dart';
21 import 'iframe_test.dart'; 21 import 'iframe_test.dart';
22 22
23 /// A class that manages the connection to a single running browser. 23 /// A class that manages the connection to a single running browser.
24 /// 24 ///
25 /// This is in charge of telling the browser which test suites to load and 25 /// This is in charge of telling the browser which test suites to load and
26 /// converting its responses into [Suite] objects. 26 /// converting its responses into [Suite] objects.
27 class BrowserManager { 27 class BrowserManager {
28 /// The browser that this is managing. 28 /// The browser that this is managing.
29 final TestPlatform browser; 29 final TestPlatform browser;
30 30
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 if (response["type"] == "error") { 135 if (response["type"] == "error") {
136 closeIframe(); 136 closeIframe();
137 var asyncError = RemoteException.deserialize(response["error"]); 137 var asyncError = RemoteException.deserialize(response["error"]);
138 await new Future.error( 138 await new Future.error(
139 new LoadException(path, asyncError.error), 139 new LoadException(path, asyncError.error),
140 asyncError.stackTrace); 140 asyncError.stackTrace);
141 } 141 }
142 142
143 return new Suite(response["tests"].map((test) { 143 return new RunnerSuite(response["tests"].map((test) {
144 var testMetadata = new Metadata.deserialize(test['metadata']); 144 var testMetadata = new Metadata.deserialize(test['metadata']);
145 var testChannel = suiteChannel.virtualChannel(test['channel']); 145 var testChannel = suiteChannel.virtualChannel(test['channel']);
146 return new IframeTest(test['name'], testMetadata, testChannel, 146 return new IframeTest(test['name'], testMetadata, testChannel,
147 mapper: mapper); 147 mapper: mapper);
148 }), platform: browser, metadata: metadata, path: path, 148 }), platform: browser, metadata: metadata, path: path,
149 onClose: () => closeIframe()); 149 onClose: () => closeIframe());
150 } 150 }
151 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698