summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 21:12:18 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 21:12:18 +0000
commit6a0f19bb6ba4b69ac0b03bebd0afac8a4d00615b (patch)
tree6bde08f22cd9b6df2eb59db1d5755651086bb315
parent36772954a95f88199d63dfd2e2d657bb2f2342b4 (diff)
downloadchromium_src-6a0f19bb6ba4b69ac0b03bebd0afac8a4d00615b.zip
chromium_src-6a0f19bb6ba4b69ac0b03bebd0afac8a4d00615b.tar.gz
chromium_src-6a0f19bb6ba4b69ac0b03bebd0afac8a4d00615b.tar.bz2
Add a PRESUBMIT.py for Chrome Frame. As many of the checks will be common
across CF and CEEE, this just reuses the ceee_presubmit.py file with some special-casing to avoid checks written for CEEE that do not apply to CF. BUG=none TEST=none Review URL: http://codereview.chromium.org/5162007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66815 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ceee/ceee_presubmit.py13
-rw-r--r--chrome_frame/PRESUBMIT.py26
2 files changed, 33 insertions, 6 deletions
diff --git a/ceee/ceee_presubmit.py b/ceee/ceee_presubmit.py
index 16820c7..5b9c6d8 100644
--- a/ceee/ceee_presubmit.py
+++ b/ceee/ceee_presubmit.py
@@ -36,7 +36,7 @@ source_files_re = re.compile('.*\.(cc|h|py|js)$')
_SRC_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-def CheckChange(input_api, output_api, committing):
+def CheckChange(input_api, output_api, committing, is_chrome_frame=False):
results = []
do_not_submit_errors = input_api.canned_checks.CheckDoNotSubmit(input_api,
@@ -52,11 +52,12 @@ def CheckChange(input_api, output_api, committing):
results += CheckHasStoryOrBug(input_api, output_api)
results += LocalChecks(input_api, output_api)
results += WarnOnAtlSmartPointers(input_api, output_api)
- results += CheckNoDllRegisterServer(input_api, output_api)
- results += CheckUnittestsRan(input_api, output_api, committing)
- if internal_presubmit:
- results += internal_presubmit.InternalChecks(input_api, output_api,
- committing)
+ if not is_chrome_frame:
+ results += CheckNoDllRegisterServer(input_api, output_api)
+ results += CheckUnittestsRan(input_api, output_api, committing)
+ if internal_presubmit:
+ results += internal_presubmit.InternalChecks(input_api, output_api,
+ committing)
return results
diff --git a/chrome_frame/PRESUBMIT.py b/chrome_frame/PRESUBMIT.py
new file mode 100644
index 0000000..11a7c80
--- /dev/null
+++ b/chrome_frame/PRESUBMIT.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+
+
+def CheckChange(input_api, output_api, committing):
+ # We need to change the path so that we can import ceee_presubmit
+ # which lies at the root of the ceee folder. And we do it here so that
+ # it doesn't pollute all the cases where we get imported yet not called.
+ sys.path.append(os.path.join(input_api.PresubmitLocalPath(), '../ceee'))
+ import ceee_presubmit
+ return ceee_presubmit.CheckChange(input_api,
+ output_api,
+ committing,
+ is_chrome_frame=True)
+
+
+def CheckChangeOnUpload(input_api, output_api):
+ return CheckChange(input_api, output_api, False)
+
+
+def CheckChangeOnCommit(input_api, output_api):
+ return CheckChange(input_api, output_api, True)