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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 CopyImageAtAndCapturePixels( | 292 CopyImageAtAndCapturePixels( |
293 web_view(), x, y, | 293 web_view(), x, y, |
294 base::Bind(&TestRunnerForSpecificView::CapturePixelsCallback, | 294 base::Bind(&TestRunnerForSpecificView::CapturePixelsCallback, |
295 weak_factory_.GetWeakPtr(), | 295 weak_factory_.GetWeakPtr(), |
296 base::Passed(std::move(persistent_callback)))); | 296 base::Passed(std::move(persistent_callback)))); |
297 } | 297 } |
298 | 298 |
299 void TestRunnerForSpecificView::GetManifestThen( | 299 void TestRunnerForSpecificView::GetManifestThen( |
300 v8::Local<v8::Function> callback) { | 300 v8::Local<v8::Function> callback) { |
| 301 if (!web_view()->MainFrame()->IsWebLocalFrame()) { |
| 302 CHECK(false) << "This function cannot be called if the main frame is not a " |
| 303 "local frame."; |
| 304 } |
| 305 |
301 v8::UniquePersistent<v8::Function> persistent_callback( | 306 v8::UniquePersistent<v8::Function> persistent_callback( |
302 blink::MainThreadIsolate(), callback); | 307 blink::MainThreadIsolate(), callback); |
303 | 308 |
304 delegate()->FetchManifest( | 309 delegate()->FetchManifest( |
305 web_view(), web_view()->MainFrame()->GetDocument().ManifestURL(), | 310 web_view(), |
| 311 web_view()->MainFrame()->ToWebLocalFrame()->GetDocument().ManifestURL(), |
306 base::Bind(&TestRunnerForSpecificView::GetManifestCallback, | 312 base::Bind(&TestRunnerForSpecificView::GetManifestCallback, |
307 weak_factory_.GetWeakPtr(), | 313 weak_factory_.GetWeakPtr(), |
308 base::Passed(std::move(persistent_callback)))); | 314 base::Passed(std::move(persistent_callback)))); |
309 } | 315 } |
310 | 316 |
311 void TestRunnerForSpecificView::GetManifestCallback( | 317 void TestRunnerForSpecificView::GetManifestCallback( |
312 v8::UniquePersistent<v8::Function> callback, | 318 v8::UniquePersistent<v8::Function> callback, |
313 const blink::WebURLResponse& response, | 319 const blink::WebURLResponse& response, |
314 const std::string& data) { | 320 const std::string& data) { |
315 PostV8CallbackWithArgs(std::move(callback), 0, nullptr); | 321 PostV8CallbackWithArgs(std::move(callback), 0, nullptr); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 | 693 |
688 blink::WebView* TestRunnerForSpecificView::web_view() { | 694 blink::WebView* TestRunnerForSpecificView::web_view() { |
689 return web_view_test_proxy_base_->web_view(); | 695 return web_view_test_proxy_base_->web_view(); |
690 } | 696 } |
691 | 697 |
692 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 698 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
693 return web_view_test_proxy_base_->delegate(); | 699 return web_view_test_proxy_base_->delegate(); |
694 } | 700 } |
695 | 701 |
696 } // namespace test_runner | 702 } // namespace test_runner |
OLD | NEW |