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( |