mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 19:18:27 +00:00
a3e9cd8ff6
The hypothesis is that a modal dialog from Internet Explorer causes the currently running test to hang until test.dart kills the browser. Capturing a screenshot might give an insight into there is a dialog showing up. BUG=https://github.com/dart-lang/sdk/issues/28955 R=johnniwinther@google.com Review-Url: https://codereview.chromium.org/2811093003 .
21 lines
694 B
PowerShell
21 lines
694 B
PowerShell
# 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]
|