Commit 32e88cac authored by tonyg@chromium.org's avatar tonyg@chromium.org

[Telemetry] Make page navigations synchronous.

This fixes a race where a stray Page.frameNavigated might be considered to be a
completion of the requested navigation.

Unfortunately, I don't know how to trigger this race in a unittest.

BUG=367306

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271655 0039d316-1c4b-4281-b951-d872f2087c98
parent f018e015
...@@ -101,19 +101,13 @@ class InspectorPage(object): ...@@ -101,19 +101,13 @@ class InspectorPage(object):
def DoNavigate(): def DoNavigate():
self._SetScriptToEvaluateOnCommit(script_to_evaluate_on_commit) self._SetScriptToEvaluateOnCommit(script_to_evaluate_on_commit)
# Navigate the page. However, there seems to be a bug in chrome devtools
# protocol where the request id for this event gets held on the browser
# side pretty much indefinitely.
#
# So, instead of waiting for the event to actually complete, wait for the
# Page.frameNavigated event.
request = { request = {
'method': 'Page.navigate', 'method': 'Page.navigate',
'params': { 'params': {
'url': url, 'url': url,
} }
} }
self._inspector_backend.SendAndIgnoreResponse(request) self._inspector_backend.SyncRequest(request, timeout)
self._navigation_url = url self._navigation_url = url
self.PerformActionAndWaitForNavigate(DoNavigate, timeout) self.PerformActionAndWaitForNavigate(DoNavigate, timeout)
......
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