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

Side by Side Diff: components/test_runner/pixel_dump.cc

Issue 2171503005: Rename WebTestProxy to WebViewTestProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 4 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 unified diff | Download patch
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | components/test_runner/test_interfaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/test_runner/pixel_dump.h" 5 #include "components/test_runner/pixel_dump.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (!dump_request->callback.is_null()) 143 if (!dump_request->callback.is_null())
144 dump_request->callback.Run(bitmap); 144 dump_request->callback.Run(bitmap);
145 } 145 }
146 146
147 } // namespace 147 } // namespace
148 148
149 void DumpPixelsAsync(blink::WebView* web_view, 149 void DumpPixelsAsync(blink::WebView* web_view,
150 const LayoutTestRuntimeFlags& layout_test_runtime_flags, 150 const LayoutTestRuntimeFlags& layout_test_runtime_flags,
151 float device_scale_factor_for_test, 151 float device_scale_factor_for_test,
152 const base::Callback<void(const SkBitmap&)>& callback) { 152 const base::Callback<void(const SkBitmap&)>& callback) {
153 TRACE_EVENT0("shell", "WebTestProxyBase::CapturePixelsAsync"); 153 TRACE_EVENT0("shell", "WebViewTestProxyBase::CapturePixelsAsync");
154 DCHECK(!callback.is_null()); 154 DCHECK(!callback.is_null());
155 DCHECK(!layout_test_runtime_flags.dump_drag_image()); 155 DCHECK(!layout_test_runtime_flags.dump_drag_image());
156 156
157 std::unique_ptr<PixelsDumpRequest> pixels_request( 157 std::unique_ptr<PixelsDumpRequest> pixels_request(
158 new PixelsDumpRequest(web_view, layout_test_runtime_flags, callback)); 158 new PixelsDumpRequest(web_view, layout_test_runtime_flags, callback));
159 159
160 if (layout_test_runtime_flags.is_printing()) { 160 if (layout_test_runtime_flags.is_printing()) {
161 base::ThreadTaskRunnerHandle::Get()->PostTask( 161 base::ThreadTaskRunnerHandle::Get()->PostTask(
162 FROM_HERE, base::Bind(&CapturePixelsForPrinting, 162 FROM_HERE, base::Bind(&CapturePixelsForPrinting,
163 base::Passed(std::move(pixels_request)))); 163 base::Passed(std::move(pixels_request))));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 blink::WebImage image = static_cast<blink::WebMockClipboard*>( 200 blink::WebImage image = static_cast<blink::WebMockClipboard*>(
201 blink::Platform::current()->clipboard()) 201 blink::Platform::current()->clipboard())
202 ->readRawImage(blink::WebClipboard::Buffer()); 202 ->readRawImage(blink::WebClipboard::Buffer());
203 const SkBitmap& bitmap = image.getSkBitmap(); 203 const SkBitmap& bitmap = image.getSkBitmap();
204 SkAutoLockPixels autoLock(bitmap); 204 SkAutoLockPixels autoLock(bitmap);
205 callback.Run(bitmap); 205 callback.Run(bitmap);
206 } 206 }
207 207
208 } // namespace test_runner 208 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | components/test_runner/test_interfaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698