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

Unified Diff: tools/capture_screenshot.ps1

Issue 2811093003: Attempt at capturing screenshot on IE if tests time out (Closed)
Patch Set: addressed comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/testing/dart/browser_controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/capture_screenshot.ps1
diff --git a/tools/capture_screenshot.ps1 b/tools/capture_screenshot.ps1
new file mode 100644
index 0000000000000000000000000000000000000000..322f9af12ca529d6a0a25bd8b8b51d2a53189818
--- /dev/null
+++ b/tools/capture_screenshot.ps1
@@ -0,0 +1,20 @@
+# 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]
« no previous file with comments | « no previous file | tools/testing/dart/browser_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698