Index: components/test_runner/pixel_dump.h |
diff --git a/components/test_runner/pixel_dump.h b/components/test_runner/pixel_dump.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8330925063fc7bd8812e7691dd03a0844c4dd239 |
--- /dev/null |
+++ b/components/test_runner/pixel_dump.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_TEST_RUNNER_PIXEL_DUMP_H_ |
+#define COMPONENTS_TEST_RUNNER_PIXEL_DUMP_H_ |
+ |
+#include "base/callback_forward.h" |
+#include "components/test_runner/test_runner_export.h" |
+ |
+class SkBitmap; |
+ |
+namespace blink { |
+class WebView; |
+} // namespace blink |
+ |
+namespace test_runner { |
+ |
+class LayoutTestRuntimeFlags; |
+ |
+// Dumps image snapshot of |web_view|. Exact dump mode depends on |flags| (i.e. |
+// dump_selection_rect and/or is_printing). Caller needs to ensure that |
+// |layout_test_runtime_flags| stays alive until |callback| gets called. |
+TEST_RUNNER_EXPORT void DumpPixelsAsync( |
+ blink::WebView* web_view, |
+ const LayoutTestRuntimeFlags& layout_test_runtime_flags, |
+ float device_scale_factor_for_test, |
+ const base::Callback<void(const SkBitmap&)>& callback); |
+ |
+// Copy to clipboard the image present at |x|, |y| coordinates in |web_view| |
+// and pass the captured image to |callback|. |
+void CopyImageAtAndCapturePixels( |
+ blink::WebView* web_view, |
+ int x, |
+ int y, |
+ const base::Callback<void(const SkBitmap&)>& callback); |
+ |
+} // namespace test_runner |
+ |
+#endif // COMPONENTS_TEST_RUNNER_PIXEL_DUMP_H_ |