| 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 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 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1896 return; | 1896 return; |
| 1897 } | 1897 } |
| 1898 | 1898 |
| 1899 print('--------------------------------------------------------------------'); | 1899 print('--------------------------------------------------------------------'); |
| 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 = [ | 1910 final args = [ |
| 1911 '-ExecutionPolicy', | 1911 '-ExecutionPolicy', |
| 1912 'ByPass', | 1912 'ByPass', |
| 1913 '-File', | 1913 '-File', |
| 1914 powerShellScript, | 1914 powerShellScript, |
| 1915 screenshotFile | 1915 screenshotFile |
| 1916 ]; | 1916 ]; |
| 1917 final ProcessResult result = | 1917 final ProcessResult result = |
| 1918 await Process.run('powershell.exe', args, runInShell: true); | 1918 await Process.run('powershell.exe', args, runInShell: true); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1937 'exit code: ${result.exitCode}\n' | 1937 'exit code: ${result.exitCode}\n' |
| 1938 'stdout: ${result.stdout}\n' | 1938 'stdout: ${result.stdout}\n' |
| 1939 'stderr: ${result.stderr}'); | 1939 'stderr: ${result.stderr}'); |
| 1940 } else { | 1940 } else { |
| 1941 print('[$message] Successfully uploaded screenshot to $storageUrl'); | 1941 print('[$message] Successfully uploaded screenshot to $storageUrl'); |
| 1942 } | 1942 } |
| 1943 new File(screenshotFile).deleteSync(); | 1943 new File(screenshotFile).deleteSync(); |
| 1944 } | 1944 } |
| 1945 print('--------------------------------------------------------------------'); | 1945 print('--------------------------------------------------------------------'); |
| 1946 } | 1946 } |
| OLD | NEW |