summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-07 22:32:11 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-07 22:32:11 +0000
commitb9a383d78d91cce289b8208d730319a23e1c2c3e (patch)
treec68c14266f583f369b8d82f13e354b14d358c16a
parente7fc06b283720e7611f2a8f53ed20cd7fdac1740 (diff)
downloadchromium_src-b9a383d78d91cce289b8208d730319a23e1c2c3e.zip
chromium_src-b9a383d78d91cce289b8208d730319a23e1c2c3e.tar.gz
chromium_src-b9a383d78d91cce289b8208d730319a23e1c2c3e.tar.bz2
Fix extension docs presubmit. One, not all, of the subdirs should have matching static docs.
BUG=111465 Review URL: https://chromiumcodereview.appspot.com/10834214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150431 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/PRESUBMIT.py6
-rwxr-xr-xchrome/common/extensions/PRESUBMIT_test.py13
2 files changed, 14 insertions, 5 deletions
diff --git a/chrome/common/extensions/PRESUBMIT.py b/chrome/common/extensions/PRESUBMIT.py
index 1ab0964..46865d1 100644
--- a/chrome/common/extensions/PRESUBMIT.py
+++ b/chrome/common/extensions/PRESUBMIT.py
@@ -147,9 +147,9 @@ def StaticDocBuilt(static_file, input_api):
"""
for subdir in [APPS_DIR, EXTENSIONS_DIR]:
generated_file = _FindFileInAlternateDir(static_file, subdir, input_api)
- if not _ChangesMatch(generated_file, static_file):
- return False
- return True
+ if _ChangesMatch(generated_file, static_file):
+ return True
+ return False
def _FindFileInAlternateDir(affected_file, alt_dir, input_api):
"""Return an AffectFile for the file in |alt_dir| that corresponds to
diff --git a/chrome/common/extensions/PRESUBMIT_test.py b/chrome/common/extensions/PRESUBMIT_test.py
index ac7a182d..d20ab930 100755
--- a/chrome/common/extensions/PRESUBMIT_test.py
+++ b/chrome/common/extensions/PRESUBMIT_test.py
@@ -259,18 +259,27 @@ class TestPresubmit(unittest.TestCase):
FakeAffectedFile(local_path='chrome/common/extensions/docs/two.html')])
self.assertFalse(PRESUBMIT.NonGeneratedFilesEdited(input_api))
- def testStaticDocBuilt_ChangesMatch(self):
+ def testStaticDocBuilt_ChangesMatchApps(self):
static_file = FakeAffectedFile(
local_path='chrome/common/extensions/docs/static/index.html',
changed_contents=[(3, 'foo!'), (4, 'bar!')])
generated_apps_file = FakeAffectedFile(
local_path='chrome/common/extensions/docs/apps/index.html',
changed_contents=[(13, 'foo!'), (14, 'bar!')])
+ input_api = FakeInputApi(affected_files=[
+ generated_apps_file,
+ static_file])
+
+ self.assertTrue(PRESUBMIT.StaticDocBuilt(static_file, input_api))
+
+ def testStaticDocBuilt_ChangesMatchExtensions(self):
+ static_file = FakeAffectedFile(
+ local_path='chrome/common/extensions/docs/static/index.html',
+ changed_contents=[(3, 'foo!'), (4, 'bar!')])
generated_extensions_file = FakeAffectedFile(
local_path='chrome/common/extensions/docs/extensions/index.html',
changed_contents=[(13, 'foo!'), (14, 'bar!')])
input_api = FakeInputApi(affected_files=[
- generated_apps_file,
generated_extensions_file,
static_file])