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

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

Issue 1097183003: Add an "onPlatform" parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 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 | « lib/src/runner/browser/iframe_test.dart ('k') | lib/src/runner/loader.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.runner.browser.server; 5 library test.runner.browser.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 Future<BrowserManager> _browserManagerFor(TestPlatform platform) { 346 Future<BrowserManager> _browserManagerFor(TestPlatform platform) {
347 var manager = _browserManagers[platform]; 347 var manager = _browserManagers[platform];
348 if (manager != null) return manager; 348 if (manager != null) return manager;
349 349
350 var completer = new Completer(); 350 var completer = new Completer();
351 351
352 // Swallow errors, since they're already being surfaced through the return 352 // Swallow errors, since they're already being surfaced through the return
353 // value and [browser.onError]. 353 // value and [browser.onError].
354 _browserManagers[platform] = completer.future.catchError((_) {}); 354 _browserManagers[platform] = completer.future.catchError((_) {});
355 var path = _webSocketHandler.create(webSocketHandler((webSocket) { 355 var path = _webSocketHandler.create(webSocketHandler((webSocket) {
356 completer.complete(new BrowserManager(webSocket)); 356 completer.complete(new BrowserManager(platform, webSocket));
357 })); 357 }));
358 358
359 var webSocketUrl = url.replace(scheme: 'ws').resolve(path); 359 var webSocketUrl = url.replace(scheme: 'ws').resolve(path);
360 360
361 var hostUrl = (_pubServeUrl == null ? url : _pubServeUrl) 361 var hostUrl = (_pubServeUrl == null ? url : _pubServeUrl)
362 .resolve('packages/test/src/runner/browser/static/index.html'); 362 .resolve('packages/test/src/runner/browser/static/index.html');
363 363
364 var browser = _newBrowser(hostUrl.replace(queryParameters: { 364 var browser = _newBrowser(hostUrl.replace(queryParameters: {
365 'managerUrl': webSocketUrl.toString() 365 'managerUrl': webSocketUrl.toString()
366 }), platform); 366 }), platform);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 if (_pubServeUrl == null) { 414 if (_pubServeUrl == null) {
415 new Directory(_compiledDir).deleteSync(recursive: true); 415 new Directory(_compiledDir).deleteSync(recursive: true);
416 } else { 416 } else {
417 _http.close(); 417 _http.close();
418 } 418 }
419 419
420 _closeCompleter.complete(); 420 _closeCompleter.complete();
421 }).catchError(_closeCompleter.completeError); 421 }).catchError(_closeCompleter.completeError);
422 } 422 }
423 } 423 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/iframe_test.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698