OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:core'; | 7 import 'dart:core'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 | 10 |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 randomFile.close(); | 786 randomFile.close(); |
787 } | 787 } |
788 | 788 |
789 Future<bool> start(String url) { | 789 Future<bool> start(String url) { |
790 _logEvent("Starting firefox browser on: $url"); | 790 _logEvent("Starting firefox browser on: $url"); |
791 // Get the version and log that. | 791 // Get the version and log that. |
792 return Process.run(_binary, ["--version"]).then((var versionResult) { | 792 return Process.run(_binary, ["--version"]).then((var versionResult) { |
793 if (versionResult.exitCode != 0) { | 793 if (versionResult.exitCode != 0) { |
794 _logEvent("Failed to firefox get version"); | 794 _logEvent("Failed to firefox get version"); |
795 _logEvent("Make sure $_binary is a valid program for running firefox"); | 795 _logEvent("Make sure $_binary is a valid program for running firefox"); |
796 return new Future<bool>.value(false); | 796 return new Future.value(false); |
797 } | 797 } |
798 version = versionResult.stdout as String; | 798 version = versionResult.stdout as String; |
799 _logEvent("Got version: $version"); | 799 _logEvent("Got version: $version"); |
800 | 800 |
801 return Directory.systemTemp.createTemp().then((userDir) { | 801 return Directory.systemTemp.createTemp().then((userDir) { |
802 _createPreferenceFile(userDir.path); | 802 _createPreferenceFile(userDir.path); |
803 _cleanup = () { | 803 _cleanup = () { |
804 userDir.deleteSync(recursive: true); | 804 userDir.deleteSync(recursive: true); |
805 }; | 805 }; |
806 var args = [ | 806 var args = [ |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 'exit code: ${result.exitCode}\n' | 1918 'exit code: ${result.exitCode}\n' |
1919 'stdout: ${result.stdout}\n' | 1919 'stdout: ${result.stdout}\n' |
1920 'stderr: ${result.stderr}'); | 1920 'stderr: ${result.stderr}'); |
1921 } else { | 1921 } else { |
1922 print('[$message] Successfully uploaded screenshot to $storageUrl'); | 1922 print('[$message] Successfully uploaded screenshot to $storageUrl'); |
1923 } | 1923 } |
1924 new File(screenshotFile).deleteSync(); | 1924 new File(screenshotFile).deleteSync(); |
1925 } | 1925 } |
1926 print('--------------------------------------------------------------------'); | 1926 print('--------------------------------------------------------------------'); |
1927 } | 1927 } |
OLD | NEW |