Commit 8a854532 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Fix a race between suspended and waiting messages in DevToolsSession

If a message comes right before navigation, and we send it out but
never get a response from the old renderer (e.g. it was killed), and
then suspend messages due to navigation, the original message is
stuck in waiting_for_response_messages_ and will not be dispatched
when resuming upon navigation finish.

To mitigate this, we move all waiting messages to suspended if
we are not resending them to new renderer due to being currently
suspended.

Bug: 803678
Change-Id: I125609e0ec8a5e2b98ff2d81a9e71732fc8f6f0f
Reviewed-on: https://chromium-review.googlesource.com/887435Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532307}
parent fa3af1aa
...@@ -122,17 +122,12 @@ _OS_SPECIFIC_FILTER['linux'] = [ ...@@ -122,17 +122,12 @@ _OS_SPECIFIC_FILTER['linux'] = [
'ChromeDriverTest.testWindowMaximize', 'ChromeDriverTest.testWindowMaximize',
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=2132 # https://bugs.chromium.org/p/chromedriver/issues/detail?id=2132
'MobileEmulationCapabilityTest.testDeviceMetricsWithDeviceWidth', 'MobileEmulationCapabilityTest.testDeviceMetricsWithDeviceWidth',
# https://bugs.chromium.org/p/chromium/issues/detail?id=803678
'ChromeDriverTest.testGoBackAndGoForward',
'ChromeDriverTest.testAlertHandlingOnPageUnload',
] ]
_OS_SPECIFIC_FILTER['mac'] = [ _OS_SPECIFIC_FILTER['mac'] = [
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=1927 # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1927
'MobileEmulationCapabilityTest.testTapElement', 'MobileEmulationCapabilityTest.testTapElement',
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=1945 # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1945
'ChromeDriverTest.testWindowFullScreen', 'ChromeDriverTest.testWindowFullScreen',
# https://bugs.chromium.org/p/chromium/issues/detail?id=803678
'ChromeDriverTest.testGoBackAndGoForward',
] ]
_DESKTOP_NEGATIVE_FILTER = [ _DESKTOP_NEGATIVE_FILTER = [
......
...@@ -84,6 +84,13 @@ void DevToolsSession::AttachToAgent( ...@@ -84,6 +84,13 @@ void DevToolsSession::AttachToAgent(
const WaitingMessage& message = pair.second; const WaitingMessage& message = pair.second;
DispatchProtocolMessageToAgent(call_id, message.method, message.message); DispatchProtocolMessageToAgent(call_id, message.method, message.message);
} }
} else {
std::vector<SuspendedMessage> temp;
for (const auto& pair : waiting_for_response_messages_)
temp.push_back({pair.first, pair.second.method, pair.second.message});
suspended_messages_.insert(suspended_messages_.begin(), temp.begin(),
temp.end());
waiting_for_response_messages_.clear();
} }
// Set cookie to an empty string to reattach next time instead of attaching. // Set cookie to an empty string to reattach next time instead of attaching.
......
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