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 3cc1fb7a9f1c331cbd0715647e6d908475a8ae47..11dfca60f51c252ed3fda101c77deee6a9b4b0ae 100644 |
--- a/components/test_runner/test_runner_for_specific_view.cc |
+++ b/components/test_runner/test_runner_for_specific_view.cc |
@@ -673,7 +673,11 @@ bool TestRunnerForSpecificView::FindString( |
} |
std::string TestRunnerForSpecificView::SelectionAsMarkup() { |
- return web_view()->mainFrame()->selectionAsMarkup().utf8(); |
+ if (!web_view()->mainFrame()->toWebLocalFrame()) { |
+ CHECK(false) << "This function cannot be called if the main frame is not a " |
+ "local frame."; |
+ } |
+ return web_view()->mainFrame()->toWebLocalFrame()->selectionAsMarkup().utf8(); |
} |
void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, |