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

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 2962073002: OOPIF support for layout test pixel dumps.
Patch Set: Rebasing on top of 8bc8e844008b (still works locally). Created 3 years, 5 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
Index: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index 39c1e32df3f613121db58a49038bb68c4c3a9fe6..d98ee062c2bf1df27c8348b2f366d54bed2612d2 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -822,6 +822,7 @@ bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ShellViewMsg_ReplyBluetoothManualChooserEvents,
OnReplyBluetoothManualChooserEvents)
IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpCompleted, OnLayoutDumpCompleted)
+ IPC_MESSAGE_HANDLER(ShellViewMsg_PixelsDumpResult, OnPixelsDumpResult)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -916,6 +917,21 @@ void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) {
CaptureDumpContinued();
}
+void BlinkTestRunner::DumpPixelsAsync(
+ base::OnceCallback<void(const SkBitmap&)> callback) {
+ DCHECK(!callback.is_null()); // Caller should verify.
+ CHECK(pixels_dump_callback_.is_null())
+ << "Only one pixel dump at a time is supported.";
+
+ pixels_dump_callback_ = std::move(callback);
+ Send(new ShellViewHostMsg_InitiatePixelsDump(routing_id()));
+}
+
+void BlinkTestRunner::OnPixelsDumpResult(const SkBitmap& result) {
+ std::move(pixels_dump_callback_).Run(result);
+ pixels_dump_callback_.Reset();
+}
+
void BlinkTestRunner::CaptureDumpContinued() {
test_runner::WebTestInterfaces* interfaces =
LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();

Powered by Google App Engine
This is Rietveld 408576698