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

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

Issue 1062643002: Add an additional closed check to BrowserServer. (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 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Future<Suite> loadSuite(String path) { 158 Future<Suite> loadSuite(String path) {
159 return new Future.sync(() { 159 return new Future.sync(() {
160 if (_pubServeUrl != null) { 160 if (_pubServeUrl != null) {
161 var suitePrefix = p.withoutExtension(p.relative(path, from: 'test')) + 161 var suitePrefix = p.withoutExtension(p.relative(path, from: 'test')) +
162 '.browser_test'; 162 '.browser_test';
163 var jsUrl = _pubServeUrl.resolve('$suitePrefix.dart.js'); 163 var jsUrl = _pubServeUrl.resolve('$suitePrefix.dart.js');
164 return _pubServeSuite(path, jsUrl) 164 return _pubServeSuite(path, jsUrl)
165 .then((_) => _pubServeUrl.resolve('$suitePrefix.html')); 165 .then((_) => _pubServeUrl.resolve('$suitePrefix.html'));
166 } else { 166 } else {
167 return _compileSuite(path).then((dir) { 167 return _compileSuite(path).then((dir) {
168 if (_closed) return null;
169
168 // Add a trailing slash because at least on Chrome, the iframe's 170 // Add a trailing slash because at least on Chrome, the iframe's
169 // window.location.href will do so automatically, and if that differs 171 // window.location.href will do so automatically, and if that differs
170 // from the original URL communication will fail. 172 // from the original URL communication will fail.
171 return url.resolve( 173 return url.resolve(
172 "/" + p.toUri(p.relative(dir, from: _compiledDir)).path + "/"); 174 "/" + p.toUri(p.relative(dir, from: _compiledDir)).path + "/");
173 }); 175 });
174 } 176 }
175 }).then((suiteUrl) { 177 }).then((suiteUrl) {
176 if (_closed) return null; 178 if (_closed) return null;
177 179
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 if (_pubServeUrl == null) { 264 if (_pubServeUrl == null) {
263 new Directory(_compiledDir).deleteSync(recursive: true); 265 new Directory(_compiledDir).deleteSync(recursive: true);
264 } else { 266 } else {
265 _http.close(); 267 _http.close();
266 } 268 }
267 269
268 _closeCompleter.complete(); 270 _closeCompleter.complete();
269 }).catchError(_closeCompleter.completeError); 271 }).catchError(_closeCompleter.completeError);
270 } 272 }
271 } 273 }
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