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

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

Issue 1890493002: PlzNavigate: properly execute BeforeUnload on renderer initiated navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + fixed issue with layout test Created 4 years, 6 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 | « no previous file | content/browser/frame_host/navigator_impl.cc » ('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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698