Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: tools/telemetry/telemetry/core/chrome/inspector_page.py

Issue 13926007: [Telemetry] Fix race in tab.Navigate's script_to_evaluate_on_commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/chrome/inspector_page.py
diff --git a/tools/telemetry/telemetry/core/chrome/inspector_page.py b/tools/telemetry/telemetry/core/chrome/inspector_page.py
index d5eac724285358cca9720a44fde8e99793b56d25..4253c286a62629516bc1bea1cf31728f9732df5b 100644
--- a/tools/telemetry/telemetry/core/chrome/inspector_page.py
+++ b/tools/telemetry/telemetry/core/chrome/inspector_page.py
@@ -71,6 +71,14 @@ class InspectorPage(object):
"""
def DoNavigate():
+ if script_to_evaluate_on_commit:
+ request = {
+ 'method': 'Page.addScriptToEvaluateOnLoad',
+ 'params': {
+ 'scriptSource': script_to_evaluate_on_commit,
+ }
+ }
+ self._inspector_backend.SendAndIgnoreResponse(request)
# 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.
@@ -84,14 +92,6 @@ class InspectorPage(object):
}
}
self._inspector_backend.SendAndIgnoreResponse(request)
- if script_to_evaluate_on_commit:
- request = {
- 'method': 'Page.addScriptToEvaluateOnLoad',
- 'params': {
- 'scriptSource': script_to_evaluate_on_commit,
- }
- }
- self._inspector_backend.SendAndIgnoreResponse(request)
self.PerformActionAndWaitForNavigate(DoNavigate, timeout)
def GetCookieByName(self, name, timeout=60):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698