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

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

Issue 1061903006: Avoid a platform-specific errno in pub_serve_test. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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 | « 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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 Failed to load "test/my_test.dart": 221 Failed to load "test/my_test.dart":
222 Error getting http://localhost:54321/my_test.vm_test.dart: Connection refused 222 Error getting http://localhost:54321/my_test.vm_test.dart: Connection refused
223 Make sure "pub serve" is running. 223 Make sure "pub serve" is running.
224 ''')); 224 '''));
225 expect(result.exitCode, equals(exit_codes.data)); 225 expect(result.exitCode, equals(exit_codes.data));
226 }); 226 });
227 227
228 test("gracefully handles pub serve not running for browser tests", () { 228 test("gracefully handles pub serve not running for browser tests", () {
229 var result = runUnittest(['--pub-serve=54321', '-p', 'chrome'], 229 var result = runUnittest(['--pub-serve=54321', '-p', 'chrome'],
230 workingDirectory: _sandbox); 230 workingDirectory: _sandbox);
231 expect(result.stderr, equals(''' 231 expect(result.stderr, matches(r'''
232 Failed to load "test/my_test.dart": 232 Failed to load "test/my_test\.dart":
233 Error getting http://localhost:54321/my_test.browser_test.dart.js: Connection re fused (errno 111) 233 Error getting http://localhost:54321/my_test\.browser_test.dart\.js: Connection refused \(errno \d+\)
234 Make sure "pub serve" is running. 234 Make sure "pub serve" is running\.
235 ''')); 235 '''));
236 expect(result.exitCode, equals(exit_codes.data)); 236 expect(result.exitCode, equals(exit_codes.data));
237 }); 237 });
238 238
239 test("gracefully handles a test file not being in test/", () { 239 test("gracefully handles a test file not being in test/", () {
240 new File(p.join(_sandbox, 'test/my_test.dart')) 240 new File(p.join(_sandbox, 'test/my_test.dart'))
241 .copySync(p.join(_sandbox, 'my_test.dart')); 241 .copySync(p.join(_sandbox, 'my_test.dart'));
242 242
243 var result = runUnittest(['--pub-serve=54321', 'my_test.dart'], 243 var result = runUnittest(['--pub-serve=54321', 'my_test.dart'],
244 workingDirectory: _sandbox); 244 workingDirectory: _sandbox);
245 expect(result.stderr, equals( 245 expect(result.stderr, equals(
246 'Failed to load "my_test.dart": When using "pub serve", all test files ' 246 'Failed to load "my_test.dart": When using "pub serve", all test files '
247 'must be in test/.\n')); 247 'must be in test/.\n'));
248 }); 248 });
249 } 249 }
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