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

Unified Diff: telemetry/telemetry/page/cache_temperature.py

Issue 2127483002: [PCv2] Avoid hash navigation by inserting navigation to different URL. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: add_note Created 4 years, 5 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: telemetry/telemetry/page/cache_temperature.py
diff --git a/telemetry/telemetry/page/cache_temperature.py b/telemetry/telemetry/page/cache_temperature.py
index 9f367d8435c3bbfffdf47c4587a0497677d7b956..7d1f98194600667474a72e96043f78c3530969fb 100644
--- a/telemetry/telemetry/page/cache_temperature.py
+++ b/telemetry/telemetry/page/cache_temperature.py
@@ -71,6 +71,15 @@ def EnsurePageCacheTemperature(page, browser, previous_page=None):
previous_page.url == page.url and
(previous_page.cache_temperature == PCV1_COLD or
previous_page.cache_temperature == PCV1_WARM)):
+ if '#' in page.url:
+ # Navigate to inexistent URL to avoid in-page hash navigation.
+ # Note: Unlike PCv1, PCv2 iterates the same URL for different cache
+ # configurations. This may issue blink in-page hash navigations,
+ # which isn't intended here.
+ with MarkTelemetryInternal(browser, 'avoid_double_hash_navigation'):
+ tab = browser.tabs[0]
+ tab.Navigate("http://does.not.exist")
+ tab.WaitForDocumentReadyStateToBeComplete()
return
with MarkTelemetryInternal(browser, 'warmCache'):
« 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