Commit 297eab63 authored by alexmos's avatar alexmos Committed by Commit bot

OOPIF: Don't crash when running layout tests that have an OOP iframe.

This CLs fixes a few places in layout test code that were assuming
that the top-level frame is local, which was causing renderer crashes
when running a layout test containing a cross-site frame with
--site-per-process.  For example, most tests under
http/tests/security/postMessage/ ran into this.

BUG=474792
TEST=http/tests/security/postMessage/* tests don't crash with --site-per-process

Review URL: https://codereview.chromium.org/1073533002

Cr-Commit-Position: refs/heads/master@{#324311}
parent 27e19fba
......@@ -657,14 +657,17 @@ void WebKitTestRunner::Reset() {
current_entry_indexes_.clear();
render_view()->ClearEditCommands();
render_view()->GetWebView()->mainFrame()->setName(WebString());
if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame())
render_view()->GetWebView()->mainFrame()->setName(WebString());
render_view()->GetWebView()->mainFrame()->clearOpener();
// Resetting the internals object also overrides the WebPreferences, so we
// have to sync them to WebKit again.
WebTestingSupport::resetInternalsObject(
render_view()->GetWebView()->mainFrame()->toWebLocalFrame());
render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences());
if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame()) {
WebTestingSupport::resetInternalsObject(
render_view()->GetWebView()->mainFrame()->toWebLocalFrame());
render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences());
}
}
// Private methods -----------------------------------------------------------
......
......@@ -168,7 +168,7 @@ void AccessibilityController::NotificationReceived(
v8::HandleScope handle_scope(isolate);
blink::WebFrame* frame = web_view_->mainFrame();
if (!frame)
if (!frame || frame->isWebRemoteFrame())
return;
v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment