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

Unified Diff: build/android/pylib/results/presentation/test_results_presentation.py

Issue 2799153008: Add back buttons and load new 'pages' by calling javascript. (Closed)
Patch Set: remove obsolete functions Created 3 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
Index: build/android/pylib/results/presentation/test_results_presentation.py
diff --git a/build/android/pylib/results/presentation/test_results_presentation.py b/build/android/pylib/results/presentation/test_results_presentation.py
index ea51689f283bfe7a6ab8803da29f1f645751ea58..17729d0d65696313e2ce767bff199a86c17186e8 100755
--- a/build/android/pylib/results/presentation/test_results_presentation.py
+++ b/build/android/pylib/results/presentation/test_results_presentation.py
@@ -78,6 +78,22 @@ def links_cell(links, html_class='center', rowspan=None):
}
+def action_cell(action, data, html_class):
mikecase (-- gone --) 2017/04/07 23:57:20 I do not think we should pass javascript functions
BigBossZhiling 2017/04/10 19:43:51 Acknowledged.
+ """Formats table cell with javascript actions.
+
+ Args:
+ action: Javscript action.
+ data: Data in cell.
+ class: Class for table cell.
+ """
+ return {
+ 'cell_type': 'action',
+ 'action': action,
+ 'data': data,
+ 'class': html_class,
+ }
+
+
def logs_cell(result):
"""Formats result logs data for processing in jinja template."""
link_list = []
@@ -165,13 +181,11 @@ def create_suite_table(results_dict):
]
footer_row = [
- links_cell(
- links=[
- link(href=('?suite=%s' % 'TOTAL'),
- target=LinkTarget.CURRENT_TAB,
- data='TOTAL')
- ],
- ), # suite_name
+ action_cell(
+ 'showTestsOfOneSuiteOnly(\'TOTAL\')',
mikecase (-- gone --) 2017/04/10 17:03:06 nit: use double quotes here instead of \'
BigBossZhiling 2017/04/10 19:43:51 Done.
+ 'TOTAL',
+ 'center'
+ ), # TOTAL
cell(data=0), # number_success_tests
cell(data=0), # number_fail_tests
cell(data=0), # all_tests
@@ -191,12 +205,10 @@ def create_suite_table(results_dict):
suite_row = suite_row_dict[suite_name]
else:
suite_row = [
- links_cell(
- links=[
- link(href=('?suite=%s' % suite_name),
- target=LinkTarget.CURRENT_TAB,
- data=suite_name)],
- html_class='left'
+ action_cell(
+ 'showTestsOfOneSuiteOnly(\'%s\')' % suite_name,
mikecase (-- gone --) 2017/04/10 17:03:06 same here
BigBossZhiling 2017/04/10 19:43:51 Done.
+ suite_name,
+ 'left'
), # suite_name
cell(data=0), # number_success_tests
cell(data=0), # number_fail_tests

Powered by Google App Engine
This is Rietveld 408576698