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

Unified 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: Addressed comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_runner_for_specific_view.cc
diff --git a/components/test_runner/test_runner_for_specific_view.cc b/components/test_runner/test_runner_for_specific_view.cc
index 75b8d0d0475439642e4ecaf5c7329df7e73ab5d7..30d5082a915b0131874a3a40f012c5aa81f87aa1 100644
--- a/components/test_runner/test_runner_for_specific_view.cc
+++ b/components/test_runner/test_runner_for_specific_view.cc
@@ -566,7 +566,13 @@ void TestRunnerForSpecificView::DidLosePointerLockInternal() {
}
bool TestRunnerForSpecificView::CallShouldCloseOnWebView() {
- return web_view()->mainFrame()->dispatchBeforeUnloadEvent();
+ if (!web_view()->mainFrame()->toWebLocalFrame()) {
+ CHECK(false) << "This function cannot be called if the main frame is not a "
dcheng 2016/05/10 04:55:03 Why can't we just let toWebLocalFrame() explode? I
clamy 2016/05/26 09:43:54 I think the CHECK(false) here makes it clearer to
+ "local frame.";
+ }
+
+ return web_view()->mainFrame()->toWebLocalFrame()->dispatchBeforeUnloadEvent(
+ false);
}
void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme(
« 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