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

Side by Side Diff: tools/testing/dart/browser_controller.dart

Issue 2817553005: Try work around issues executing powershell scripts on windows on the bots (Closed)
Patch Set: Created 3 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) 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 library browser; 4 library browser;
5 5
6 import "dart:async"; 6 import "dart:async";
7 import "dart:convert" show UTF8, JSON; 7 import "dart:convert" show UTF8, JSON;
8 import "dart:core"; 8 import "dart:core";
9 import "dart:io"; 9 import "dart:io";
10 import "dart:math" show min; 10 import "dart:math" show min;
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 final String date = 1900 final String date =
1901 new DateTime.now().toUtc().toIso8601String().replaceAll(':', '_'); 1901 new DateTime.now().toUtc().toIso8601String().replaceAll(':', '_');
1902 final screenshotName = 'ie_screenshot_${date}.png'; 1902 final screenshotName = 'ie_screenshot_${date}.png';
1903 1903
1904 // The "capture_screen.ps1" script is next to "test.dart" in "tools/" 1904 // The "capture_screen.ps1" script is next to "test.dart" in "tools/"
1905 final powerShellScript = 1905 final powerShellScript =
1906 Platform.script.resolve('capture_screenshot.ps1').toFilePath(); 1906 Platform.script.resolve('capture_screenshot.ps1').toFilePath();
1907 final screenshotFile = 1907 final screenshotFile =
1908 Platform.script.resolve('../$screenshotName').toFilePath(); 1908 Platform.script.resolve('../$screenshotName').toFilePath();
1909 1909
1910 final args = [powerShellScript, screenshotFile]; 1910 final args = [
1911 '-ExecutionPolicy',
1912 'ByPass',
1913 '-File ',
ricow1 2017/04/12 10:25:42 nit: remove space after -File?
kustermann 2017/04/12 10:27:00 Done.
1914 powerShellScript,
1915 screenshotFile
1916 ];
1911 final ProcessResult result = 1917 final ProcessResult result =
1912 await Process.run('powershell.exe', args, runInShell: true); 1918 await Process.run('powershell.exe', args, runInShell: true);
1913 if (result.exitCode != 0) { 1919 if (result.exitCode != 0) {
1914 print('[$message] Failed to capture IE screenshot on windows: ' 1920 print('[$message] Failed to capture IE screenshot on windows: '
1915 'powershell.exe "${args.join(' ')}" returned with:\n' 1921 'powershell.exe "${args.join(' ')}" returned with:\n'
1916 'exit code: ${result.exitCode}\n' 1922 'exit code: ${result.exitCode}\n'
1917 'stdout: ${result.stdout}\n' 1923 'stdout: ${result.stdout}\n'
1918 'stderr: ${result.stderr}'); 1924 'stderr: ${result.stderr}');
1919 } else { 1925 } else {
1920 final storageUrl = 'gs://dart-temp-crash-archive/$screenshotName'; 1926 final storageUrl = 'gs://dart-temp-crash-archive/$screenshotName';
(...skipping 10 matching lines...) Expand all
1931 'exit code: ${result.exitCode}\n' 1937 'exit code: ${result.exitCode}\n'
1932 'stdout: ${result.stdout}\n' 1938 'stdout: ${result.stdout}\n'
1933 'stderr: ${result.stderr}'); 1939 'stderr: ${result.stderr}');
1934 } else { 1940 } else {
1935 print('[$message] Successfully uploaded screenshot to $storageUrl'); 1941 print('[$message] Successfully uploaded screenshot to $storageUrl');
1936 } 1942 }
1937 new File(screenshotFile).deleteSync(); 1943 new File(screenshotFile).deleteSync();
1938 } 1944 }
1939 print('--------------------------------------------------------------------'); 1945 print('--------------------------------------------------------------------');
1940 } 1946 }
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