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

Unified Diff: test/runner/pub_serve_test.dart

Issue 1101773002: Add Windows support. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Unused import 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/loader_test.dart ('k') | test/runner/signal_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/pub_serve_test.dart
diff --git a/test/runner/pub_serve_test.dart b/test/runner/pub_serve_test.dart
index cd0c7931b29e2ed44365cbd0eb9f05f7e65919be..57646ec21a45380c781cf2b11dfacdc0589db9c5 100644
--- a/test/runner/pub_serve_test.dart
+++ b/test/runner/pub_serve_test.dart
@@ -73,6 +73,13 @@ class MyTransformer extends Transformer {
});
tearDown(() {
+ // On Windows, there's no way to shut down the actual "pub serve" process.
+ // Killing the process we start will just kill the batch file wrapper (issue
+ // 23304), not the underlying "pub serve" process. Since that process has
+ // locks on files in the sandbox, we can't delete the sandbox on Windows
+ // without errors.
+ if (Platform.isWindows) return;
+
new Directory(_sandbox).deleteSync(recursive: true);
});
@@ -158,7 +165,7 @@ class MyTransformer extends Transformer {
workingDirectory: _sandbox);
expect(result.stdout, allOf([
contains('-1: load error'),
- contains('Failed to load "test/my_test.dart":'),
+ contains('Failed to load "${p.join("test", "my_test.dart")}":'),
contains('404 Not Found'),
contains('Make sure "pub serve" is serving the test/ directory.')
]));
@@ -188,7 +195,7 @@ class MyTransformer extends Transformer {
workingDirectory: _sandbox);
expect(result.stdout, allOf([
contains('-1: load error'),
- contains('Failed to load "test/my_test.dart":'),
+ contains('Failed to load "${p.join("test", "my_test.dart")}":'),
contains('404 Not Found'),
contains('Make sure "pub serve" is serving the test/ directory.')
]));
@@ -313,7 +320,7 @@ void main() {
expect(result.stdout, allOf([
contains('-1: load error'),
contains('''
- Failed to load "test/my_test.dart":
+ Failed to load "${p.join("test", "my_test.dart")}":
Error getting http://localhost:54321/my_test.dart.vm_test.dart: Connection refused
Make sure "pub serve" is running.''')
]));
@@ -323,11 +330,15 @@ void main() {
test("gracefully handles pub serve not running for browser tests", () {
var result = runTest(['--pub-serve=54321', '-p', 'chrome'],
workingDirectory: _sandbox);
+ var message = Platform.isWindows
+ ? 'The remote computer refused the network connection.'
+ : 'Connection refused (errno ';
+
expect(result.stdout, allOf([
contains('-1: load error'),
- contains('Failed to load "test/my_test.dart":'),
+ contains('Failed to load "${p.join("test", "my_test.dart")}":'),
contains('Error getting http://localhost:54321/my_test.dart.browser_test'
- '.dart.js: Connection refused (errno '),
+ '.dart.js: $message'),
contains('Make sure "pub serve" is running.')
]));
expect(result.exitCode, equals(1));
« no previous file with comments | « test/runner/loader_test.dart ('k') | test/runner/signal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698