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

Side by Side Diff: test/runner/browser/chrome_test.dart

Issue 1017323004: Autoselect a port rather than always using 8080 for chrome_test. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 import 'package:unittest/src/runner/browser/chrome.dart'; 9 import 'package:unittest/src/runner/browser/chrome.dart';
10 import 'package:unittest/src/util/io.dart'; 10 import 'package:unittest/src/util/io.dart';
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 webSocket.first 110 webSocket.first
111 .then((message) => expect(message, equals('null'))) 111 .then((message) => expect(message, equals('null')))
112 .whenComplete(chrome.close), 112 .whenComplete(chrome.close),
113 completes); 113 completes);
114 } 114 }
115 }, count: 2)); 115 }, count: 2));
116 }); 116 });
117 }); 117 });
118 118
119 test("a process can be killed synchronously after it's started", () { 119 test("a process can be killed synchronously after it's started", () {
120 return shelf_io.serve(expectAsync((_) {}, count: 0), 'localhost', 8080) 120 return shelf_io.serve(expectAsync((_) {}, count: 0), 'localhost', 0)
121 .then((server) { 121 .then((server) {
122 var chrome = new Chrome(baseUrlForAddress(server.address, server.port)); 122 var chrome = new Chrome(baseUrlForAddress(server.address, server.port));
123 return chrome.close().whenComplete(server.close); 123 return chrome.close().whenComplete(server.close);
124 }); 124 });
125 }); 125 });
126 126
127 test("reports an error in onExit", () { 127 test("reports an error in onExit", () {
128 var chrome = new Chrome("http://dart-lang.org", 128 var chrome = new Chrome("http://dart-lang.org",
129 executable: "_does_not_exist"); 129 executable: "_does_not_exist");
130 expect(chrome.onExit, throwsA(new isInstanceOf<ProcessException>())); 130 expect(chrome.onExit, throwsA(new isInstanceOf<ProcessException>()));
131 }); 131 });
132 } 132 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698