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

Unified Diff: lib/src/runner/browser/content_shell.dart

Issue 1265333002: Only fetch the Observatory URL in debug mode. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 4 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 | « lib/src/runner/browser/browser_manager.dart ('k') | lib/src/runner/browser/dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/content_shell.dart
diff --git a/lib/src/runner/browser/content_shell.dart b/lib/src/runner/browser/content_shell.dart
index 03038d85a7fd7ccb4e3d171ed636243d5b787fbc..77ff14926ad9071be1f61ce398be922395b28043 100644
--- a/lib/src/runner/browser/content_shell.dart
+++ b/lib/src/runner/browser/content_shell.dart
@@ -25,7 +25,7 @@ class ContentShell extends Browser {
final Future<Uri> observatoryUrl;
- factory ContentShell(url, {String executable}) {
+ factory ContentShell(url, {String executable, bool debug: false}) {
var completer = new Completer.sync();
return new ContentShell._(() async {
if (executable == null) executable = _defaultExecutable();
@@ -34,13 +34,15 @@ class ContentShell extends Browser {
executable, ["--dump-render-tree", url.toString()],
environment: {"DART_FLAGS": "--checked"});
- // The first observatory URL emitted is for the empty start page; the
- // second is actually for the host page.
- completer.complete(lineSplitter.bind(process.stdout).map((line) {
- var match = _observatoryRegExp.firstMatch(line);
- if (match == null) return null;
- return Uri.parse(match[1]);
- }).where((uri) => uri != null).first);
+ if (debug) {
+ completer.complete(lineSplitter.bind(process.stdout).map((line) {
+ var match = _observatoryRegExp.firstMatch(line);
+ if (match == null) return null;
+ return Uri.parse(match[1]);
+ }).where((uri) => uri != null).first);
+ } else {
+ completer.complete(null);
+ }
lineSplitter.bind(process.stderr).listen((line) {
if (line != "[dartToStderr]: Dartium build has expired") return;
« no previous file with comments | « lib/src/runner/browser/browser_manager.dart ('k') | lib/src/runner/browser/dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698