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

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

Issue 1062683004: Preliminary safari support. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Polish 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/safari.dart ('k') | test/runner/browser/runner_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 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 13 matching lines...) Expand all
24 import '../../utils.dart'; 24 import '../../utils.dart';
25 import '../load_exception.dart'; 25 import '../load_exception.dart';
26 import 'browser.dart'; 26 import 'browser.dart';
27 import 'browser_manager.dart'; 27 import 'browser_manager.dart';
28 import 'compiler_pool.dart'; 28 import 'compiler_pool.dart';
29 import 'chrome.dart'; 29 import 'chrome.dart';
30 import 'dartium.dart'; 30 import 'dartium.dart';
31 import 'content_shell.dart'; 31 import 'content_shell.dart';
32 import 'firefox.dart'; 32 import 'firefox.dart';
33 import 'phantom_js.dart'; 33 import 'phantom_js.dart';
34 import 'safari.dart';
34 35
35 /// A server that serves JS-compiled tests to browsers. 36 /// A server that serves JS-compiled tests to browsers.
36 /// 37 ///
37 /// A test suite may be loaded for a given file using [loadSuite]. 38 /// A test suite may be loaded for a given file using [loadSuite].
38 class BrowserServer { 39 class BrowserServer {
39 /// Starts the server. 40 /// Starts the server.
40 /// 41 ///
41 /// [root] is the root directory that the server should serve. It defaults to 42 /// [root] is the root directory that the server should serve. It defaults to
42 /// the working directory. 43 /// the working directory.
43 /// 44 ///
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 361 }
361 362
362 /// Starts the browser identified by [browser] and has it load [url]. 363 /// Starts the browser identified by [browser] and has it load [url].
363 Browser _newBrowser(Uri url, TestPlatform browser) { 364 Browser _newBrowser(Uri url, TestPlatform browser) {
364 switch (browser) { 365 switch (browser) {
365 case TestPlatform.dartium: return new Dartium(url); 366 case TestPlatform.dartium: return new Dartium(url);
366 case TestPlatform.contentShell: return new ContentShell(url); 367 case TestPlatform.contentShell: return new ContentShell(url);
367 case TestPlatform.chrome: return new Chrome(url); 368 case TestPlatform.chrome: return new Chrome(url);
368 case TestPlatform.phantomJS: return new PhantomJS(url); 369 case TestPlatform.phantomJS: return new PhantomJS(url);
369 case TestPlatform.firefox: return new Firefox(url); 370 case TestPlatform.firefox: return new Firefox(url);
371 case TestPlatform.safari: return new Safari(url);
370 default: 372 default:
371 throw new ArgumentError("$browser is not a browser."); 373 throw new ArgumentError("$browser is not a browser.");
372 } 374 }
373 } 375 }
374 376
375 /// Closes the server and releases all its resources. 377 /// Closes the server and releases all its resources.
376 /// 378 ///
377 /// Returns a [Future] that completes once the server is closed and its 379 /// Returns a [Future] that completes once the server is closed and its
378 /// resources have been fully released. 380 /// resources have been fully released.
379 Future close() { 381 Future close() {
(...skipping 13 matching lines...) Expand all
393 if (_pubServeUrl == null) { 395 if (_pubServeUrl == null) {
394 new Directory(_compiledDir).deleteSync(recursive: true); 396 new Directory(_compiledDir).deleteSync(recursive: true);
395 } else { 397 } else {
396 _http.close(); 398 _http.close();
397 } 399 }
398 400
399 _closeCompleter.complete(); 401 _closeCompleter.complete();
400 }).catchError(_closeCompleter.completeError); 402 }).catchError(_closeCompleter.completeError);
401 } 403 }
402 } 404 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/safari.dart ('k') | test/runner/browser/runner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698