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

Side by Side Diff: content/test/gpu/page_sets/PRESUBMIT.py

Issue 2300653002: [tools/perf] Update code to reference py_utils.cloud_storage (Closed)
Patch Set: update Created 4 years, 3 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
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | tools/auto_bisect/fetch_build.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 """Presubmit script for changes affecting content/test/gpu/page_sets/. 5 """Presubmit script for changes affecting content/test/gpu/page_sets/.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
11 import os 11 import os
12 import sys 12 import sys
13 13
14 14
15 def _GetChromiumSrcDir(input_api): 15 def _GetChromiumSrcDir(input_api):
16 return input_api.os_path.abspath(input_api.os_path.join( 16 return input_api.os_path.abspath(input_api.os_path.join(
17 input_api.PresubmitLocalPath(), '..', '..', '..', '..')) 17 input_api.PresubmitLocalPath(), '..', '..', '..', '..'))
18 18
19 19
20 def _CheckWprShaFiles(input_api, output_api): 20 def _CheckWprShaFiles(input_api, output_api):
21 """Check whether the wpr sha files have matching URLs.""" 21 """Check whether the wpr sha files have matching URLs."""
22 old_sys_path = sys.path 22 old_sys_path = sys.path
23 try: 23 try:
24 catapult_base_path = input_api.os_path.join( 24 py_utils_path = input_api.os_path.join(
25 _GetChromiumSrcDir(input_api), 'third_party', 'catapult', 25 _GetChromiumSrcDir(input_api), 'third_party', 'catapult', 'common',
26 'catapult_base') 26 'py_utils')
27 sys.path.insert(1, catapult_base_path) 27 sys.path.insert(1, py_utils_path)
28 from catapult_base import cloud_storage # pylint: disable=import-error 28 from py_utils import cloud_storage # pylint: disable=import-error
29 finally: 29 finally:
30 sys.path = old_sys_path 30 sys.path = old_sys_path
31 31
32 results = [] 32 results = []
33 for affected_file in input_api.AffectedFiles(include_deletes=False): 33 for affected_file in input_api.AffectedFiles(include_deletes=False):
34 filename = affected_file.AbsoluteLocalPath() 34 filename = affected_file.AbsoluteLocalPath()
35 if not filename.endswith('wpr.sha1'): 35 if not filename.endswith('wpr.sha1'):
36 continue 36 continue
37 expected_hash = cloud_storage.ReadHash(filename) 37 expected_hash = cloud_storage.ReadHash(filename)
38 is_wpr_file_uploaded = any( 38 is_wpr_file_uploaded = any(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 def CheckChangeOnUpload(input_api, output_api): 75 def CheckChangeOnUpload(input_api, output_api):
76 results = [] 76 results = []
77 results.extend(_CommonChecks(input_api, output_api)) 77 results.extend(_CommonChecks(input_api, output_api))
78 return results 78 return results
79 79
80 80
81 def CheckChangeOnCommit(input_api, output_api): 81 def CheckChangeOnCommit(input_api, output_api):
82 results = [] 82 results = []
83 results.extend(_CommonChecks(input_api, output_api)) 83 results.extend(_CommonChecks(input_api, output_api))
84 return results 84 return results
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | tools/auto_bisect/fetch_build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698