Commit be880666 authored by Andrey Lushnikov's avatar Andrey Lushnikov Committed by Commit Bot

DevTools: fix browser-side navigation of paused page inside renderer

When navigating page inside the same renderer with browser-side
navigation, we are too late with unpausing the Page.

As a result, the page still considers itself paused and hits
a DCHECK in DocumentLoader::FinishedLoading.

R=dgozman

Change-Id: I0998b94c4a379c23bd44d56a6cb7c9fb4aa3bb5c
Reviewed-on: https://chromium-review.googlesource.com/1132378
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574016}
parent 886a3c80
Tests that we can navigate away from paused page.
SUCCESS: Paused
SUCCESS: navigated from paused page.
(async function(testRunner) {
const {page, session, dp} = await testRunner.startBlank('Tests that we can navigate away from paused page.');
await dp.Runtime.enable();
await dp.Debugger.enable();
await dp.Page.enable();
await dp.Page.setLifecycleEventsEnabled({enabled: true});
// Start tight loop in page.
session.evaluate(`debugger;`),
await dp.Debugger.oncePaused(),
testRunner.log('SUCCESS: Paused');
await dp.Page.navigate({url: 'about:blank'});
await dp.Page.onceLifecycleEvent(event => event.params.name === 'load');
testRunner.log('SUCCESS: navigated from paused page.');
testRunner.completeTest();
})
...@@ -168,18 +168,17 @@ class ClientMessageLoopAdapter : public MainThreadDebugger::ClientMessageLoop { ...@@ -168,18 +168,17 @@ class ClientMessageLoopAdapter : public MainThreadDebugger::ClientMessageLoop {
// 3. Process messages until quitNow is called. // 3. Process messages until quitNow is called.
message_loop_->Run(); message_loop_->Run();
// 4. Resume active objects
WebView::DidExitModalLoop();
// 5. Enable input events.
WebFrameWidgetBase::SetIgnoreInputEvents(false);
} }
void QuitNow() override { void QuitNow() override {
if (running_for_debug_break_) { if (running_for_debug_break_) {
running_for_debug_break_ = false; running_for_debug_break_ = false;
// Undo steps (3), (2) and (1) from above.
// NOTE: This code used to be above right after the |mesasge_loop_->Run()|
// code, but it is moved here to support browser-side navigation.
message_loop_->QuitNow(); message_loop_->QuitNow();
WebView::DidExitModalLoop();
WebFrameWidgetBase::SetIgnoreInputEvents(false);
} }
} }
......
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