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

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

Issue 1175163003: Factor out some common logic from the launchers. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: fix test Created 5 years, 6 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 | « test/runner/browser/internet_explorer_test.dart ('k') | test/runner/browser/safari_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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:async'; 7 import 'dart:async';
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 await phantomJS.close(); 151 await phantomJS.close();
152 } finally { 152 } finally {
153 server.close(); 153 server.close();
154 } 154 }
155 }); 155 });
156 156
157 test("reports an error in onExit", () { 157 test("reports an error in onExit", () {
158 var phantomJS = new PhantomJS("http://dart-lang.org", 158 var phantomJS = new PhantomJS("http://dart-lang.org",
159 executable: "_does_not_exist"); 159 executable: "_does_not_exist");
160 expect(phantomJS.onExit, throwsA(isApplicationException(startsWith( 160 expect(phantomJS.onExit, throwsA(isApplicationException(startsWith(
161 "Failed to start PhantomJS: $noSuchFileMessage")))); 161 "Failed to run PhantomJS: $noSuchFileMessage"))));
162 }); 162 });
163 163
164 test("can run successful tests", () { 164 test("can run successful tests", () {
165 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" 165 new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
166 import 'package:test/test.dart'; 166 import 'package:test/test.dart';
167 167
168 void main() { 168 void main() {
169 test("success", () {}); 169 test("success", () {});
170 } 170 }
171 """); 171 """);
(...skipping 11 matching lines...) Expand all
183 } 183 }
184 """); 184 """);
185 185
186 var result = _runTest(["-p", "phantomjs", "test.dart"]); 186 var result = _runTest(["-p", "phantomjs", "test.dart"]);
187 expect(result.exitCode, equals(1)); 187 expect(result.exitCode, equals(1));
188 }); 188 });
189 } 189 }
190 190
191 ProcessResult _runTest(List<String> args) => 191 ProcessResult _runTest(List<String> args) =>
192 runTest(args, workingDirectory: _sandbox); 192 runTest(args, workingDirectory: _sandbox);
OLDNEW
« no previous file with comments | « test/runner/browser/internet_explorer_test.dart ('k') | test/runner/browser/safari_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698