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

Unified Diff: chrome/test/functional/ispy/server/main_view_handler.py

Issue 106523003: [I-Spy] Add support for rebaselining expectations from the web UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing dom.py Created 6 years, 12 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: chrome/test/functional/ispy/server/main_view_handler.py
diff --git a/chrome/test/functional/ispy/server/main_view_handler.py b/chrome/test/functional/ispy/server/main_view_handler.py
index f6c2c72d8439ff690d85c057659d9c043fef73fb..40cc1f75aa21fa5f756d2061ccb68acd717cb10d 100644
--- a/chrome/test/functional/ispy/server/main_view_handler.py
+++ b/chrome/test/functional/ispy/server/main_view_handler.py
@@ -11,8 +11,9 @@ import re
import sys
import webapp2
-from ..common import constants
-from ..common import ispy_utils
+from common import chrome_utils
+from common import constants
+from common import ispy_utils
import gs_bucket
import views
@@ -67,19 +68,19 @@ class MainViewHandler(webapp2.RequestHandler):
"""
paths = set([path for path in ispy.GetAllPaths('failures/' + test_run)
if path.endswith('actual.png')])
+ can_rebaseline = chrome_utils.ChromeUtils(
+ ispy.cloud_bucket).CanRebaselineToTestRun(test_run)
rows = [self._CreateRow(test_run, path, ispy) for path in paths]
- if rows:
- # Function that sorts by the different_pixels field in the failure-info.
- def _Sorter(a, b):
- return cmp(b['percent_different'],
- a['percent_different'])
- template = JINJA.get_template('main_view.html')
- self.response.write(
- template.render({'comparisons': sorted(rows, _Sorter),
- 'test_run': test_run}))
- else:
- template = JINJA.get_template('empty_view.html')
- self.response.write(template.render())
+
+ # Function that sorts by the different_pixels field in the failure-info.
+ def _Sorter(a, b):
+ return cmp(b['percent_different'],
+ a['percent_different'])
+ template = JINJA.get_template('main_view.html')
+ self.response.write(
+ template.render({'comparisons': sorted(rows, _Sorter),
+ 'test_run': test_run,
+ 'can_rebaseline': can_rebaseline}))
def _CreateRow(self, test_run, path, ispy):
"""Creates one failure-row.
« no previous file with comments | « chrome/test/functional/ispy/server/image_handler.py ('k') | chrome/test/functional/ispy/server/rebaseline_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698