OLD | NEW |
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 "content/shell/test_runner/test_runner_for_specific_view.h" | 5 #include "content/shell/test_runner/test_runner_for_specific_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 v8::Isolate* isolate = blink::MainThreadIsolate(); | 248 v8::Isolate* isolate = blink::MainThreadIsolate(); |
249 v8::HandleScope handle_scope(isolate); | 249 v8::HandleScope handle_scope(isolate); |
250 | 250 |
251 v8::Local<v8::Context> context = | 251 v8::Local<v8::Context> context = |
252 web_view()->MainFrame()->MainWorldScriptContext(); | 252 web_view()->MainFrame()->MainWorldScriptContext(); |
253 if (context.IsEmpty()) | 253 if (context.IsEmpty()) |
254 return; | 254 return; |
255 | 255 |
256 v8::Context::Scope context_scope(context); | 256 v8::Context::Scope context_scope(context); |
257 v8::Local<v8::Value> argv[3]; | 257 v8::Local<v8::Value> argv[3]; |
258 SkAutoLockPixels snapshot_lock(snapshot); | |
259 | 258 |
260 // Size can be 0 for cases where copyImageAt was called on position | 259 // Size can be 0 for cases where copyImageAt was called on position |
261 // that doesn't have an image. | 260 // that doesn't have an image. |
262 int width = snapshot.info().width(); | 261 int width = snapshot.info().width(); |
263 argv[0] = v8::Number::New(isolate, width); | 262 argv[0] = v8::Number::New(isolate, width); |
264 | 263 |
265 int height = snapshot.info().height(); | 264 int height = snapshot.info().height(); |
266 argv[1] = v8::Number::New(isolate, height); | 265 argv[1] = v8::Number::New(isolate, height); |
267 | 266 |
268 // Skia's internal byte order is platform-dependent. Always convert to RGBA | 267 // Skia's internal byte order is platform-dependent. Always convert to RGBA |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 687 |
689 blink::WebView* TestRunnerForSpecificView::web_view() { | 688 blink::WebView* TestRunnerForSpecificView::web_view() { |
690 return web_view_test_proxy_base_->web_view(); | 689 return web_view_test_proxy_base_->web_view(); |
691 } | 690 } |
692 | 691 |
693 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 692 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
694 return web_view_test_proxy_base_->delegate(); | 693 return web_view_test_proxy_base_->delegate(); |
695 } | 694 } |
696 | 695 |
697 } // namespace test_runner | 696 } // namespace test_runner |
OLD | NEW |