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

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

Issue 1964843002: SharedPageState ensures specified page cache temperature. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: add smoketestws Created 4 years, 7 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 | « telemetry/telemetry/page/cache_temperature_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/page/shared_page_state.py
diff --git a/telemetry/telemetry/page/shared_page_state.py b/telemetry/telemetry/page/shared_page_state.py
index e9667510935aafcfd6ab3dd3404dbc2538589d12..2e969edc696476ff820affbe404346a322b63572 100644
--- a/telemetry/telemetry/page/shared_page_state.py
+++ b/telemetry/telemetry/page/shared_page_state.py
@@ -16,6 +16,7 @@ from telemetry.internal.browser import browser_info as browser_info_module
from telemetry.internal.platform.profiler import profiler_finder
from telemetry.internal.util import exception_formatter
from telemetry.internal.util import file_handle
+from telemetry.page import cache_temperature
from telemetry.page import legacy_page_test
from telemetry import story
from telemetry.util import image_util
@@ -76,6 +77,7 @@ class SharedPageState(story.SharedState):
self._first_browser = True
self._did_login_for_current_page = False
+ self._previous_page = None
self._current_page = None
self._current_tab = None
@@ -158,6 +160,7 @@ class SharedPageState(story.SharedState):
try:
if self._current_tab and self._current_tab.IsAlive():
self._current_tab.CloseConnections()
+ self._previous_page = self._current_page
except Exception:
if self._current_tab:
self._current_tab.Close()
@@ -269,6 +272,9 @@ class SharedPageState(story.SharedState):
if started_browser:
self.browser.tabs[0].WaitForDocumentReadyStateToBeComplete()
+ cache_temperature.EnsurePageCacheTemperature(
+ self._current_page, self.browser, self._previous_page)
+
# Start profiling if needed.
if self._finder_options.profiler:
self._StartProfiling(self._current_page)
« no previous file with comments | « telemetry/telemetry/page/cache_temperature_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698