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

Unified Diff: tools/telemetry/telemetry/page/page_runner.py

Issue 650253002: [Telemetry] Remove logic that handles case test=None in page_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix stray diff Created 6 years, 2 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/page/page_runner.py
diff --git a/tools/telemetry/telemetry/page/page_runner.py b/tools/telemetry/telemetry/page/page_runner.py
index 02867a7b72ff02b8ece47c8c046730a1be835b6f..d576254f6ca038a80eda399000521b488909f4b8 100644
--- a/tools/telemetry/telemetry/page/page_runner.py
+++ b/tools/telemetry/telemetry/page/page_runner.py
@@ -19,7 +19,6 @@ from telemetry.core import wpr_modes
from telemetry.core.platform.profiler import profiler_finder
from telemetry.page import page_filter
from telemetry.page import page_test
-from telemetry.page.actions import navigate
from telemetry.page.actions import page_action
from telemetry.results import results_options
from telemetry.util import cloud_storage
@@ -140,14 +139,14 @@ class _RunState(object):
self.browser.platform.profiling_controller.Stop()
-class PageState(object):
+class _PageState(object):
def __init__(self, page, tab):
self.page = page
self.tab = tab
self._did_login = False
- def PreparePage(self, test=None):
+ def PreparePage(self, test):
if self.page.is_file:
self.tab.browser.SetHTTPServerDirectories(
self.page.page_set.serving_dirs | set([self.page.serving_dir]))
@@ -158,22 +157,17 @@ class PageState(object):
raise page_test.Failure('Login as ' + self.page.credentials + ' failed')
self._did_login = True
- if test:
- if test.clear_cache_before_each_run:
- self.tab.ClearCache(force=True)
+ if test.clear_cache_before_each_run:
+ self.tab.ClearCache(force=True)
- def ImplicitPageNavigation(self, test=None):
+ def ImplicitPageNavigation(self, test):
"""Executes the implicit navigation that occurs for every page iteration.
This function will be called once per page before any actions are executed.
"""
- if test:
- test.WillNavigateToPage(self.page, self.tab)
- test.RunNavigateSteps(self.page, self.tab)
- test.DidNavigateToPage(self.page, self.tab)
- else:
- i = navigate.NavigateAction()
- i.RunAction(self.page, self.tab, None)
+ test.WillNavigateToPage(self.page, self.tab)
+ test.RunNavigateSteps(self.page, self.tab)
+ test.DidNavigateToPage(self.page, self.tab)
def CleanUpPage(self, test):
test.CleanUpAfterPage(self.page, self.tab)
@@ -470,7 +464,7 @@ def _RunPage(test, page, state, expectation, results):
results.AddValue(skip.SkipValue(page, 'Skipped by test expectations'))
return
- page_state = PageState(page, test.TabForPage(page, state.browser))
+ page_state = _PageState(page, test.TabForPage(page, state.browser))
def ProcessError():
if expectation == 'fail':
« 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