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

Unified Diff: chrome/browser/PRESUBMIT.py

Issue 253543002: web_dev_style: check webui browser tests as well. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tbreisacher@ review Created 6 years, 8 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 | « chrome/browser/OWNERS ('k') | chrome/browser/resources/PRESUBMIT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/PRESUBMIT.py
diff --git a/chrome/browser/resources/PRESUBMIT.py b/chrome/browser/PRESUBMIT.py
similarity index 80%
rename from chrome/browser/resources/PRESUBMIT.py
rename to chrome/browser/PRESUBMIT.py
index 831864c33b4236beca0807becff5abbbd535997f..76c924c26b597fcfc69da8266eb5121556a0d849 100644
--- a/chrome/browser/resources/PRESUBMIT.py
+++ b/chrome/browser/PRESUBMIT.py
@@ -22,18 +22,21 @@ def CheckChangeOnCommit(input_api, output_api):
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
- resources = input_api.PresubmitLocalPath()
path = input_api.os_path
+ cwd = input_api.PresubmitLocalPath()
+ resources = path.join(cwd, 'resources')
+ webui = path.join(cwd, 'ui', 'webui')
+
affected_files = (f.AbsoluteLocalPath() for f in input_api.AffectedFiles())
would_affect_tests = (
- path.join(resources, 'PRESUBMIT.py'),
- path.join(resources, 'test_presubmit.py'),
- path.join(resources, 'web_dev_style', 'css_checker.py'),
- path.join(resources, 'web_dev_style', 'js_checker.py'),
+ path.join(cwd, 'PRESUBMIT.py'),
+ path.join(cwd, 'test_presubmit.py'),
+ path.join(cwd, 'web_dev_style', 'css_checker.py'),
+ path.join(cwd, 'web_dev_style', 'js_checker.py'),
)
if any(f for f in affected_files if f in would_affect_tests):
- tests = [path.join(resources, 'test_presubmit.py')]
+ tests = [path.join(cwd, 'test_presubmit.py')]
results.extend(
input_api.canned_checks.RunUnitTests(input_api, output_api, tests))
@@ -41,11 +44,12 @@ def _CommonChecks(input_api, output_api):
old_path = sys.path
try:
- sys.path = [resources] + old_path
+ sys.path = [cwd] + old_path
from web_dev_style import css_checker, js_checker
+ search_dirs = (resources, webui)
def _html_css_js_resource(p):
- return p.endswith(('.html', '.css', '.js')) and p.startswith(resources)
+ return p.endswith(('.html', '.css', '.js')) and p.startswith(search_dirs)
BLACKLIST = ['chrome/browser/resources/pdf/index.html',
'chrome/browser/resources/pdf/index.js']
« no previous file with comments | « chrome/browser/OWNERS ('k') | chrome/browser/resources/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698