[infra] Remove IE11 screenshot capability from test.py

This was currently broken, and would not work from shards anyway.

Change-Id: Ib32c98de0a80870b8cd1a249bea578f98e438124
Reviewed-on: https://dart-review.googlesource.com/c/87068
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
William Hesse 2018-12-12 15:42:52 +00:00
parent 8ae255d876
commit 83c6f7695d
2 changed files with 0 additions and 84 deletions

View file

@ -1,20 +0,0 @@
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen(
$bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
$bmp.Dispose()
}
$bounds = [Drawing.Rectangle]::FromLTRB(0, 0, 2000, 4000)
screenshot $bounds $args[0]

View file

@ -984,13 +984,6 @@ class BrowserTestRunner {
var id = status.browser.id;
status.currentTest.stopwatch.stop();
// Before closing the browser, we'll try to capture a screenshot on
// windows when using IE (to debug flakiness).
if (status.browser is IE) {
await captureInternetExplorerScreenshot(
'IE screenshot for ${status.currentTest.url}');
}
await status.browser.close();
var lastKnownMessage =
'Dom could not be fetched, since the test timed out.';
@ -1655,60 +1648,3 @@ body div {
return driverContent;
}
}
Future captureInternetExplorerScreenshot(String message) async {
if (Platform.environment['USERNAME'] != 'chrome-bot') {
return;
}
print('--------------------------------------------------------------------');
final String date =
new DateTime.now().toUtc().toIso8601String().replaceAll(':', '_');
final screenshotName = 'ie_screenshot_${date}.png';
// The "capture_screen.ps1" script is next to "test.dart" in "tools/"
final powerShellScript =
Platform.script.resolve('../../capture_screenshot.ps1').toFilePath();
final screenshotFile =
Platform.script.resolve('../../../$screenshotName').toFilePath();
final args = [
'-ExecutionPolicy',
'ByPass',
'-File',
powerShellScript,
screenshotFile
];
final ProcessResult result =
await Process.run('powershell.exe', args, runInShell: true);
if (result.exitCode != 0) {
print('[$message] Failed to capture IE screenshot on windows: '
'powershell.exe "${args.join(' ')}" returned with:\n'
'exit code: ${result.exitCode}\n'
'stdout: ${result.stdout}\n'
'stderr: ${result.stderr}');
} else {
final gsutilScript = Platform.script
.resolve('../../../third_party/gsutil/gsutil.py')
.toFilePath();
final storageUrl = 'gs://dart-temp-crash-archive/$screenshotName';
final args = [
gsutilScript,
'cp',
screenshotFile,
storageUrl,
];
final ProcessResult result = await Process.run('python', args);
if (result.exitCode != 0) {
print('[$message] Failed upload captured IE screenshot to cloud storage: '
'"${args.join(' ')}" returned with:\n'
'exit code: ${result.exitCode}\n'
'stdout: ${result.stdout}\n'
'stderr: ${result.stderr}');
} else {
print('[$message] Successfully uploaded screenshot to $storageUrl');
}
new File(screenshotFile).deleteSync();
}
print('--------------------------------------------------------------------');
}