| 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 "components/test_runner/test_runner_for_specific_view.h" | 5 #include "components/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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 } | 559 } |
| 560 | 560 |
| 561 void TestRunnerForSpecificView::DidLosePointerLockInternal() { | 561 void TestRunnerForSpecificView::DidLosePointerLockInternal() { |
| 562 bool was_locked = pointer_locked_; | 562 bool was_locked = pointer_locked_; |
| 563 pointer_locked_ = false; | 563 pointer_locked_ = false; |
| 564 if (was_locked) | 564 if (was_locked) |
| 565 web_view()->didLosePointerLock(); | 565 web_view()->didLosePointerLock(); |
| 566 } | 566 } |
| 567 | 567 |
| 568 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { | 568 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { |
| 569 return web_view()->mainFrame()->dispatchBeforeUnloadEvent(); | 569 if (!web_view()->mainFrame()->toWebLocalFrame()) { |
| 570 CHECK(false) << "This function cannot be called if the main frame is not a " |
| 571 "local frame."; |
| 572 } |
| 573 |
| 574 return web_view()->mainFrame()->toWebLocalFrame()->dispatchBeforeUnloadEvent( |
| 575 false); |
| 570 } | 576 } |
| 571 | 577 |
| 572 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( | 578 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( |
| 573 bool forbidden, | 579 bool forbidden, |
| 574 const std::string& scheme) { | 580 const std::string& scheme) { |
| 575 web_view()->setDomainRelaxationForbidden(forbidden, | 581 web_view()->setDomainRelaxationForbidden(forbidden, |
| 576 WebString::fromUTF8(scheme)); | 582 WebString::fromUTF8(scheme)); |
| 577 } | 583 } |
| 578 | 584 |
| 579 v8::Local<v8::Value> | 585 v8::Local<v8::Value> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 677 |
| 672 blink::WebView* TestRunnerForSpecificView::web_view() { | 678 blink::WebView* TestRunnerForSpecificView::web_view() { |
| 673 return web_test_proxy_base_->web_view(); | 679 return web_test_proxy_base_->web_view(); |
| 674 } | 680 } |
| 675 | 681 |
| 676 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 682 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
| 677 return web_test_proxy_base_->delegate(); | 683 return web_test_proxy_base_->delegate(); |
| 678 } | 684 } |
| 679 | 685 |
| 680 } // namespace test_runner | 686 } // namespace test_runner |
| OLD | NEW |