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

Side by Side Diff: chrome/test/functional/ispy/server/update_mask_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, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Request Handler to allow test mask updates.""" 5 """Request Handler to allow test mask updates."""
6 6
7 import webapp2 7 import webapp2
8 import re 8 import re
9 import sys 9 import sys
10 import os 10 import os
11 11
12 from ..common import constants 12 from common import constants
13 from ..common import image_tools 13 from common import image_tools
14 from ..common import ispy_utils 14 from common import ispy_utils
15 15
16 import gs_bucket 16 import gs_bucket
17 17
18 18
19 class UpdateMaskHandler(webapp2.RequestHandler): 19 class UpdateMaskHandler(webapp2.RequestHandler):
20 """Request handler to allow test mask updates.""" 20 """Request handler to allow test mask updates."""
21 21
22 def post(self): 22 def post(self):
23 """Accepts post requests. 23 """Accepts post requests.
24 24
(...skipping 25 matching lines...) Expand all
50 # Get the failure namedtuple (which also computes the diff). 50 # Get the failure namedtuple (which also computes the diff).
51 failure = self.ispy.GetFailure(test_run, expectation) 51 failure = self.ispy.GetFailure(test_run, expectation)
52 # Upload the new mask in place of the original. 52 # Upload the new mask in place of the original.
53 self.ispy.UpdateImage( 53 self.ispy.UpdateImage(
54 ispy_utils.GetExpectationPath(expectation, 'mask.png'), 54 ispy_utils.GetExpectationPath(expectation, 'mask.png'),
55 image_tools.ConvertDiffToMask(failure.diff)) 55 image_tools.ConvertDiffToMask(failure.diff))
56 # Now that there is no diff for the two images, remove the failure. 56 # Now that there is no diff for the two images, remove the failure.
57 self.ispy.RemoveFailure(test_run, expectation) 57 self.ispy.RemoveFailure(test_run, expectation)
58 # Redirect back to the sites list for the test run. 58 # Redirect back to the sites list for the test run.
59 self.redirect('/?test_run=%s' % test_run) 59 self.redirect('/?test_run=%s' % test_run)
OLDNEW
« no previous file with comments | « chrome/test/functional/ispy/server/rebaseline_handler.py ('k') | chrome/test/functional/ispy/server/views/empty_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698