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

Unified Diff: build/dev_server.py

Issue 1310663002: Added quick links to dev server to start trace viewer directly. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 4 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: build/dev_server.py
diff --git a/build/dev_server.py b/build/dev_server.py
index c8807a957d5d5476e0f78a898ef80db890344a8b..5fbfc11090ef469ced68777cbb8e813581eb0560 100644
--- a/build/dev_server.py
+++ b/build/dev_server.py
@@ -18,16 +18,23 @@ from webapp2 import Route, RedirectHandler
from perf_insights_build import perf_insights_dev_server_config
from tracing_build import tracing_dev_server_config
-_UNIT_TEST_HTML = """<html><body>
+_MAIN_HTML = """<html><body>
<h1>Run Unit Tests</h1>
<ul>
%s
</ul>
+<h1>Quick links</h1>
+<ul>
+%s
+</ul>
</body></html>
"""
-_UNIT_TEST_LINK = '<li><a href="%s">%s</a></li>'
+_QUICK_LINKS = [
+ ('Trace File Viewer', '/tracing_examples/trace_viewer.html')
+]
+_LINK_ITEM = '<li><a href="%s">%s</a></li>'
def _GetFilesIn(basedir):
data_files = []
@@ -128,10 +135,14 @@ class SimpleDirectoryHandler(webapp2.RequestHandler):
class TestOverviewHandler(webapp2.RequestHandler):
def get(self, *args, **kwargs): # pylint: disable=unused-argument
- links = []
+ test_links = []
for name, path in kwargs.pop('pds').iteritems():
- links.append(_UNIT_TEST_LINK % (path, name))
- self.response.out.write(_UNIT_TEST_HTML % '\n'.join(links))
+ test_links.append(_LINK_ITEM % (path, name))
+ quick_links = []
+ for name, path in _QUICK_LINKS:
+ quick_links.append(_LINK_ITEM % (path, name))
+ self.response.out.write(_MAIN_HTML % ('\n'.join(test_links),
+ '\n'.join(quick_links)))
def CreateApp(pds, args):
« 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