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

Side by Side Diff: chrome/test/functional/ispy/server/rebaseline_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
(Empty)
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
3 # found in the LICENSE file.
4
5 """Request Handler that updates the Expectation version."""
6
7 import webapp2
8
9 from common import constants
10 from common import chrome_utils
11
12 import gs_bucket
13
14
15 class RebaselineHandler(webapp2.RequestHandler):
16 """Request handler to allow test mask updates."""
17
18 def post(self):
19 """Accepts post requests.
20
21 Expects a test_run as a parameter and updates the associated version file to
22 use the expectations associated with that test run.
23 """
24 test_run = self.request.get('test_run')
25
26 # Fail if test_run parameter is missing.
27 if not test_run:
28 self.response.header['Content-Type'] = 'json/application'
29 self.response.write(json.dumps(
30 {'error': '\'test_run\' must be supplied to rebaseline.'}))
31 return
32 # Otherwise, set up the utilities.
33 bucket = gs_bucket.GoogleCloudStorageBucket(constants.BUCKET)
34 chrome_util = chrome_utils.ChromeUtils(bucket)
35 # Update versions file.
36 try:
37 chrome_util.RebaselineToTestRun(test_run)
38 except:
39 self.response.header['Content-Type'] = 'json/application'
40 self.response.write(json.dumps(
41 {'error': 'Can not rebaseline to the given test run.'}))
42 return
43 # Redirect back to the sites list for the test run.
44 self.redirect('/?test_run=%s' % test_run)
OLDNEW
« no previous file with comments | « chrome/test/functional/ispy/server/main_view_handler.py ('k') | chrome/test/functional/ispy/server/update_mask_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698