0
Commit Graph

45 Commits

Author SHA1 Message Date
Giovanni Ortuño Urquidi
ab84da6d01 Fix CheckAssertAshOnlyCode presubmit
Follow up for https://crrev.com/c/3325066 that adds a test to check
deleted files are ignored and sets include_deletes to true in
the mock AffectedFiles function to match the real function.

Bug: 1278154
Change-Id: I713f462b4741f8c9d5d13e4ed576788e0de57b95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3325628
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Auto-Submit: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950362}
2021-12-10 00:53:21 +00:00
Lukasz Anforowicz
7016d05e80 Presubmit checks that reject raw_ptr<T> in Renderer-only code.
Bug: 1073933
Change-Id: I2ab8ce4c0f73d763a784e4252ed2704a2a9f087a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3296265
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946313}
2021-11-30 03:56:27 +00:00
Henrique Ferreiro
81d5800272 Fix MockInputApi.FilterSourceFile regex check
The InputApi mock was using re.search() instead of re.match(). This
meant that some tests in PRESUBMIT_tests.py would pass while the regex
wasn't working on production.

Change-Id: I5225afaa44602bfb0d8d16a1a4d0d021e1e81bb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3302819
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/main@{#946145}
2021-11-29 21:27:19 +00:00
Kevin McNee
967dd2d241 Add presubmit to cc an MPArch watchlist for uses of concerning APIs
With the MPArch project which enables projects like bfcache,
prerendering, and fenced frames, a number of assumptions in the code
base relating to a tab only having one page at a time are no longer
valid [1].

In the interest of avoiding backsliding, let's set up a watchlist for
uses of APIs which can contribute to these problematic assumptions.

[1] https://docs.google.com/document/d/1NginQ8k0w3znuwTiJ5qjYmBKgZDekvEPC22q0I4swxQ/edit?usp=sharing

Bug: 1190019
Change-Id: If06c08a922a8d80129c59bd9ba03e726fed0f25c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276815
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941694}
2021-11-15 16:09:29 +00:00
Dirk Pranke
e3c9c62d25 Reland "Migrate //PRESUBMIT*.py to Python3."
This reverts commit abee50a262.

Reason for revert: Underlying fix to
tools/translation/helper/git_helper has landed.

Original change's description:
> Revert "Migrate //PRESUBMIT*.py to Python3."
>
> This reverts commit 8b59f97def.
>
> Reason for revert:
> Breaks uploading CLs which change localized strings. See
> https://bugs.chromium.org/p/chromium/issues/detail?id=1209392.
>
> Original change's description:
> > Migrate //PRESUBMIT*.py to Python3.
> >
> > This CL migrates the root-level PRESUBMIT checks, their associated
> > tests, and and one other file that got pulled along for the ride)
> > to run under Python3 instead of Python2.
> >
> > Bug: 816629
> > Change-Id: I75f3edb34ca72458432ba54f3afa022e027f8eb9
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877897
> > Commit-Queue: Dirk Pranke <dpranke@google.com>
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#883002}
>
> Bug: 816629
> Fixed: 1209392
> Change-Id: Icf0c084f1db3d20ca76600eb67cc3f6e81b3c9f9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2899404
> Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Yutaka Hirano <yhirano@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#883359}

Bug: 816629
Change-Id: Ie70748076c06e3ebcacd18e3d69f105d94a5e5ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2901242
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#884028}
2021-05-18 18:35:59 +00:00
Kyle Horimoto
abee50a262 Revert "Migrate //PRESUBMIT*.py to Python3."
This reverts commit 8b59f97def.

Reason for revert:
Breaks uploading CLs which change localized strings. See
https://bugs.chromium.org/p/chromium/issues/detail?id=1209392.

Original change's description:
> Migrate //PRESUBMIT*.py to Python3.
>
> This CL migrates the root-level PRESUBMIT checks, their associated
> tests, and and one other file that got pulled along for the ride)
> to run under Python3 instead of Python2.
>
> Bug: 816629
> Change-Id: I75f3edb34ca72458432ba54f3afa022e027f8eb9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877897
> Commit-Queue: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#883002}

Bug: 816629
Fixed: 1209392
Change-Id: Icf0c084f1db3d20ca76600eb67cc3f6e81b3c9f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2899404
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883359}
2021-05-17 04:04:41 +00:00
Dirk Pranke
8b59f97def Migrate //PRESUBMIT*.py to Python3.
This CL migrates the root-level PRESUBMIT checks, their associated
tests, and and one other file that got pulled along for the ride)
to run under Python3 instead of Python2.

Bug: 816629
Change-Id: I75f3edb34ca72458432ba54f3afa022e027f8eb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877897
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883002}
2021-05-14 16:39:40 +00:00
Dirk Pranke
e2cbf0b8e5 Update the inclusive-language presubmit check to only check chromium src.
The //PRESUBMIT.py checks may sometimes be run on a bot that is actually
testing changes to a repo other than chromium src (e.g., v8 or ANGLE
or something). Sometimes it makes sense to run the presubmit changes
anyway, but the inclusive language check should only be run on actual
changes to chromium/src, since that's what the allowlist checks against.

This CL tweaks the check to exit early on changes for other repos, and
removes the temporary workaround we added earlier today in
f0b0b46c/#{868614).

Bug: 1194996
Change-Id: I0332768a655528e0de0fd52c63ee17ebc15b50e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2801150
Reviewed-by: Sean McCullough <seanmccullough@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#869219}
2021-04-05 18:51:52 +00:00
seanmccullough
f0b0b46ce0 [chromium/src PRESUBMIT] add failsafe for inclusive language check
If the exempt directories file is missing, just log and continue.

Bug: 1194996
Change-Id: Ibd2bad1c9a4f3f485fb7933dfea7a630400a3654
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2800492
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Sean McCullough <seanmccullough@chromium.org>
Cr-Commit-Position: refs/heads/master@{#868614}
2021-04-01 18:49:52 +00:00
Dominic Battre
645d4234a6 Check deprecation of preferences
It's a common mistake that developers just remove Register...Pref()
calls for preferences they don't need anymore. If they do this, the
preference stays in the prefs files on disk for ever. A proper approach
is to first ClearPref() the preference for some releases and then to
remove the code.

This CL introduces a presubmit warning if we detect that a
Register...Pref() call is removed from a non-unittest.

Bug: 1153014
Change-Id: If8f19933de039553ef47e0ddce12eb194df45ce1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560205
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833730}
2020-12-04 16:14:10 +00:00
Josip Sokcevic
8b6cc43b85 Use inclusive parameter names in PRESUBMIT.py
Bug: 1098562
Change-Id: I10e83b99a480d2d96b911e26b09e8db5d34a082e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333301
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795088}
2020-08-05 17:45:33 +00:00
Robert Ma
0303a3ada3 Use the new inclusive API in blink PRESUBMIT
Change the root PRESUBMIT_test_mocks.py as well to include the new API.
A compatibility layer is added to support the old API for now, and
should be removed when the old API is removed.

Fixed: 1108326
Bug: 1098560
Change-Id: I562686f265779cbdaf33134fd4d5af4bdcae6e0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314196
Commit-Queue: Robert Ma <robertma@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Robert Ma <robertma@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790926}
2020-07-22 18:48:48 +00:00
Chris Hall
59f8d0c7c6 Add presubmit check for relnotes field in accessibility changes.
R=akihiroota,dmazzoni,jam,dpranke

Change-Id: I37d5035967941da1d2e3d671426133668b87f0f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2162427
Commit-Queue: Chris Hall <chrishall@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#764594}
2020-05-01 07:31:19 +00:00
Dan Beam
35b10c1a1f Remove --color from ESLint output when running in presubmit
Fixed: 862792
Change-Id: I250e91a1db5f8df71fff33c17c7a04a9fd6c8739
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937584
Commit-Queue: Dan Beam <dbeam@chromium.org>
Auto-Submit: Dan Beam <dbeam@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719450}
2019-11-27 01:17:34 +00:00
Alexei Svitkine
137d4c668b Fix PRESUMBIT_tests.py on Windows.
MockInputApi was returning MockFile objects instead of strings
from LocalPaths() API, which apparently trips up Windows Python
APIs, but not Unix ones.

Bug: 984360
Change-Id: I0a14cc07a9406d84d6b20d104d002fe67cc4ae86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706577
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678454}
2019-07-17 21:28:24 +00:00
Julian Pastarmov
4f7af53fcb Fix the PRESUBMIT.py script to properly invoke grit
The grd reader is invoked from _GetGrdMessages with defines which
specify "chromium" build.

Drive-by fix for the MockFile to support basename on Windows.

BUG=984910
TEST=A modified grd fail doesn't trip the presubmit run.

Change-Id: I1b30dcaf8b91d40292e631ba854b4f0dfa54de69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1705799
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678407}
2019-07-17 19:25:37 +00:00
Wei-Yin Chen (陳威尹)
b1ce35493b Check parameter types in FilterSourceFile() mock
Parameters |white_list| and |black_list| in FilterSourceFile()
should be iterables, and it's fairly easy to wrongly pass a string
instead.

This checking caught _CheckCrbugLinksHaveHttps in unit tests.

Bug: 869103
Change-Id: I1cd6d62c3fa2b1500d9d7b6b35794f40e35378af
Reviewed-on: https://chromium-review.googlesource.com/1155379
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579288}
2018-07-31 02:37:01 +00:00
Vaclav Brozek
f01ed503dc Add tests for 'ForTesting' presubmit check
The root PRESUBMIT.py contains
_CheckNoProductionCodeUsingTestOnlyFunctions which checks against
including a call to a 'for testing only' method in production code.
That check has not been tested. This CL adds two tests for it.

Additionally, the CL also fixes two issues in the presubmit tests:
 * FilterSourceFile in PRESUBMIT_test_mocks.py did not match the
   production version from tools/depot_tools/presubmit_support.py: the
   production requires the filename to be in the whitelist, while the
   mock version was OK with just not being in the blacklist. The CL
   modifies the mock version to match the production.
 * The test for _CheckAndroidTestJUnitInheritance did not adhere to
   the whitelisted filename pattern (*Test.java). This CL changes the
   names of the fake files to match the pattern.

Bug: 821981
Change-Id: I65edf07ddb2ae26ad7d08ceb7cf4d51b482b5e56
Reviewed-on: https://chromium-review.googlesource.com/966605
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543783}
2018-03-16 19:38:24 +00:00
Zhiling Huang
45cabf3788 Run pydeps check only in src.
Bug: 803245
Change-Id: I645e82663991cd012ced5f19a056d08bbc2c797d
Reviewed-on: https://chromium-review.googlesource.com/952281
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Zhiling Huang <hzl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542297}
2018-03-10 00:50:03 +00:00
Sylvain Defresne
a8b73d2584 Ensure autorelease pool is drained between tests
The testing::Test fixture (used by TEST macro) does not drain the
autorelease pool after a test. PlatformTest should be used.

Add a PRESUBMIT check that neither TEST nor testing::Test is used
in iOS Objective-C++ test files. Files are assumed to be iOS if
either their base name match '\bios\b' or one of the component in
the path is 'ios'.

Expand MockInputApi to filter files in mocks of AffectedFiles and
AffectedSourceFiles function, adding missing mocked functions too.
Fix unit tests that were failing after the filtering is correctly
implemented.

Bug: none
Change-Id: I0af99b6658b8e15888dfcfb94345eb879ab9fd37
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Reviewed-on: https://chromium-review.googlesource.com/937204
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539829}
2018-02-28 15:45:54 +00:00
Daniel Cheng
7052cdff01 Auto-CC ipc-security-reviews@ when changing IPC-related files.
Bug: 786386
Change-Id: I28d5809389aa86ee274b17725ca5312d4b8bb3ae
Reviewed-on: https://chromium-review.googlesource.com/776411
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518329}
2017-11-21 19:23:29 +00:00
Daniel Cheng
264a447d21 Add tests for enforcing C++ dependencies in PRESUBMIT
This CL omits tests for directories where dependencies aren't checked:
PRESUBMIT test mocks is missing support for FileSourceFilter. This will
be added to test mocks along with the missing tests in a followup CL.

Bug: 763980
Change-Id: Ibf9265911f32d24f446e690d9ec05ddb7a61f198
Reviewed-on: https://chromium-review.googlesource.com/671812
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505189}
2017-09-28 22:17:59 +00:00
Yoland Yan
b92fa52719 Add Presubmit Warnings for Junit4
These presubmit warnings prevent people from adding new JUnit3 tests or
use inheritance in JUnit4 testing, it also prevent people from using
the deprecated JUnit framework.

For more on JUnit4 migration, please check
//testing/android/docs/junit4.md

Bug: 640116
Change-Id: I941b595f6fbc01ac60a2647ab0af64482596d9cc
Reviewed-on: https://chromium-review.googlesource.com/634603
Commit-Queue: Yoland Yan <yolandyan@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497790}
2017-08-28 17:37:06 +00:00
Daniel Cheng
13ca61a886 Enforce that mojo manifests are covered by security reviewers.
Since mojo manifests don't have a consistent naming convention, this
simply looks for JSON files with the "interface_provider_specs" key:
there are some manifests that don't specify this, but the important
part for security review is auditing what's exposed between processes.

Bug: 695922
Change-Id: Id30dae51ecc0cbfa35650ead14ef2dfd081c23d7
Reviewed-on: https://chromium-review.googlesource.com/621707
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497410}
2017-08-25 15:11:25 +00:00
dpapad
5c9c24ec6d js_checker.py: Restore smoke tests for linting violations.
Restoring test to ensure that document.getElementById() calls are flagged as
style violations, now that these checks are performed via ESLint. These tests
are not meant to be exhaustive, instead they just validate that our PRESUBMIT
integration with ESLint works.

BUG=720034

Review-Url: https://codereview.chromium.org/2917473002
Cr-Commit-Position: refs/heads/master@{#476014}
2017-05-31 20:51:34 +00:00
jbriance
2c51e821a6 Presubmit: Skip third_party for fwd decl warning
Skip presubmit warning when the introduced useless forward
declaration is made in third_party (with the exception of
blink). Take the opportunity to fix one test and style.

BUG=662195
TEST=PRESUBMIT_test.py ForwardDeclarationTest

Review-Url: https://codereview.chromium.org/2568473002
Cr-Commit-Position: refs/heads/master@{#437833}
2016-12-12 08:27:18 +00:00
jbriance
9e12f16d49 Presubmit: Warn about useless forward declarations
Checks that added or removed lines in affected header files
do not lead to new useless class or struct forward declaration.

BUG=662195
TEST=PRESUBMIT_test.py ForwardDeclarationTest

Review-Url: https://codereview.chromium.org/2532583002
Cr-Commit-Position: refs/heads/master@{#434449}
2016-11-25 07:59:45 +00:00
pastarmovj
89f7ee10f0 Adds new logging type SYSLOG which logs to the system log.
On Windows this type logs to the Event Log and on POSIX systems it logs to the messages log (or its equvalent).

As a side effect of adding the presubmit check for it this
CL fixes running the presumbit checks tests on Windows.

BUG=642115

Review-Url: https://codereview.chromium.org/2296783002
Cr-Commit-Position: refs/heads/master@{#419758}
2016-09-20 14:59:43 +00:00
rdevlin.cronin
1136682513 [Closure Externs] Fix presubmit check
Have the presubmit script check all affected files instead of only
those in the presubmit directory. Avoids false positives.

BUG=469920

Review-Url: https://codereview.chromium.org/1925273002
Cr-Commit-Position: refs/heads/master@{#390968}
2016-05-02 17:07:22 +00:00
agrieve
bb9c5b47a3 Skip the .pydeps presubmit check on windows
BUG=600604

Review URL: https://codereview.chromium.org/1911813002

Cr-Commit-Position: refs/heads/master@{#389109}
2016-04-22 15:14:34 +00:00
agrieve
f32bcc73df Reland of Include isolate.py in data for Android unit tests
Now unconditionally including some directory trees to capture imports that differ based on python version (at least those that have come up so far).

BUG=589318, 599692

Review URL: https://codereview.chromium.org/1846103005

Cr-Commit-Position: refs/heads/master@{#384907}
2016-04-04 14:59:51 +00:00
sergiyb
b4f617bded Revert of Include isolate.py in data for Android unit tests (patchset id:200001 of https://codereview.chromium.org/1840113002/ )
Reason for revert:
Speculative revert, see http://crbug.com/599692.

Original issue's description:
> Reland of Include isolate.py in data for Android unit tests
>
> Now with check disabled for non-android checkouts.
>
> This is required for any test that uses an .isolate to push files to the
> device (e.g. base_unittests).
>
> BUG=589318
>
> Committed: https://crrev.com/4b6084284590609810fb2c0653fd1b42c6fcaddb
> Cr-Commit-Position: refs/heads/master@{#384039}

TBR=jochen@chromium.org,jbudorick@chromium.org,agrieve@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=589318, 599692

Review URL: https://codereview.chromium.org/1851773002

Cr-Commit-Position: refs/heads/master@{#384557}
2016-04-01 12:03:44 +00:00
agrieve
4b60842845 Reland of Include isolate.py in data for Android unit tests
Now with check disabled for non-android checkouts.

This is required for any test that uses an .isolate to push files to the
device (e.g. base_unittests).

BUG=589318

Review URL: https://codereview.chromium.org/1840113002

Cr-Commit-Position: refs/heads/master@{#384039}
2016-03-30 18:52:08 +00:00
agrieve
e33676c3fa Revert of Include isolate.py in data for Android unit tests (patchset id:80001 of https://codereview.chromium.org/1784373002/ )
Reason for revert:
PRESUBMIT isn't working for non-android checkouts, as shown by:

https://codereview.chromium.org/1840913002/diff/1/build/android/test_runner.pydeps#oldcode138

Original issue's description:
> Include isolate.py in data for Android unit tests
>
> This is required for any test that uses an .isolate to push files to the
> device (e.g. base_unittests).
>
> BUG=589318
>
> Committed: https://crrev.com/9e299ea6bbf87415d64d9d84003162d71304ccb9
> Cr-Commit-Position: refs/heads/master@{#383127}

TBR=jochen@chromium.org,jbudorick@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=589318

Review URL: https://codereview.chromium.org/1839103002

Cr-Commit-Position: refs/heads/master@{#383733}
2016-03-29 15:48:24 +00:00
agrieve
9e299ea6bb Include isolate.py in data for Android unit tests
This is required for any test that uses an .isolate to push files to the
device (e.g. base_unittests).

BUG=589318

Review URL: https://codereview.chromium.org/1784373002

Cr-Commit-Position: refs/heads/master@{#383127}
2016-03-24 20:08:06 +00:00
rdevlin.cronin
9ab806c3e9 [Extern Generation] Add a presubmit script to check externs not being updated
Add a presubmit script that checks for when extension api files are touched, but
the corresponding extern file is not. Right now, this is very simple - it only
checks that the extern is modified in some way (doesn't validate that it's the
*right* way), and is only a warning (because sometimes api file changes don't
cause extern changes). As an improvement, we would validate that the extern
files contain the proper content - let's do that later.

This will also be rolled out piecemeal, since many APIs don't currently have a
dedicated extern file. This change only imposes the check on bluetooth (because
it was handy) - if all goes well, we'll roll this out to all api files.

Also establish a dedicated extern folder, since it's silly for chrome-generated
externs to live in third_party/.

BUG=469920

Review URL: https://codereview.chromium.org/1718243003

Cr-Commit-Position: refs/heads/master@{#378018}
2016-02-26 23:18:40 +00:00
dbeam
37e8e740cb Add presubmit warning about deprecated compiled_resources.gyp
Just use v2 instead ;) (compiled_resources2.gyp)

R=maruel@chromium.org,cpu@chromium.org
BUG=585553

Review URL: https://codereview.chromium.org/1686663002

Cr-Commit-Position: refs/heads/master@{#374762}
2016-02-10 23:00:46 +00:00
davileen
e0426257f8 Add PRESUBMIT tests for _CheckUserActionUpdate function.
Presubmit does not contain any tests for the _CheckUserActionUpdate
function. This commit adds a test to check against an action in
actions.xml and one that is not found there. To do this we have to
improve the MockInputApi and MockFile classes.

BUG=462814

Review URL: https://codereview.chromium.org/966703003

Cr-Commit-Position: refs/heads/master@{#318759}
2015-03-02 21:11:31 +00:00
gayane
940df072ba Presubmit for chrome/browser/resources matches multiline metric type.
Also added a testcase for it and a nice print of errors.

BUG=443026

Review URL: https://codereview.chromium.org/809053003

Cr-Commit-Position: refs/heads/master@{#317794}
2015-02-24 14:29:00 +00:00
glider
e61efad3b3 Reland https://codereview.chromium.org/929043002/: Add a presubmit check that warns about declaring Singleton<T> in header files
Add a presubmit check that warns about declaring Singleton<T> in header files
(except for base/memory/singleton.h)
This check is copied from presubmit_canned_checks.py in depot_tools/ with an
added exception for base/memory/singleton.h.
The corresponding code will be removed from presubmit_canned_checks.py afterwards.

BUG=349861

Review URL: https://codereview.chromium.org/933253002

Cr-Commit-Position: refs/heads/master@{#316852}
2015-02-18 17:40:14 +00:00
glider
99aac94df7 Revert of Add a presubmit check that warns about declaring Singleton<T> in header files (patchset id:20001 of https://codereview.chromium.org/929043002/)
Reason for revert:
Reverting because of presubmit crashes:

Traceback (most recent call last):
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 2983, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 2969, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/ssd/depot_tools/subcommand.py", line 245, in execute
    return command(parser, args[1:])
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 1614, in CMDpresubmit
    change=cl.GetChange(base_branch, None))
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 936, in RunHook
    rietveld_obj=self.RpcServer())
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 1396, in DoPresubmitChecks
    results += executer.ExecPresubmitScript(presubmit_script, filename)
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 1313, in ExecPresubmitScript
    result = eval(function_name + '(*__args)', context)
  File "<string>", line 1, in <module>
  File "<string>", line 1727, in CheckChangeOnCommit
  File "<string>", line 1455, in _CommonChecks
  File "<string>", line 1322, in _CheckSingletonInHeaders
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 472, in ReadFile
    raise IOError('Access outside the repository root is denied.')
IOError: Access outside the repository root is denied.

Original issue's description:
> Add a presubmit check that warns about declaring Singleton<T> in header files
> (except for base/memory/singleton.h)
> This check is copied from presubmit_canned_checks.py in depot_tools/ with an
> added exception for base/memory/singleton.h.
> The corresponding code will be removed from presubmit_canned_checks.py afterwards.
>
> BUG=349861
> R=phajdan.jr@chromium.org,
>
> Committed: https://crrev.com/9b73d0393037452d13358f4e2766cb62adbdede8
> Cr-Commit-Position: refs/heads/master@{#316546}

TBR=phajdan.jr@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=349861

Review URL: https://codereview.chromium.org/934723003

Cr-Commit-Position: refs/heads/master@{#316559}
2015-02-17 11:19:16 +00:00
glider
9b73d03930 Add a presubmit check that warns about declaring Singleton<T> in header files
(except for base/memory/singleton.h)
This check is copied from presubmit_canned_checks.py in depot_tools/ with an
added exception for base/memory/singleton.h.
The corresponding code will be removed from presubmit_canned_checks.py afterwards.

BUG=349861
R=phajdan.jr@chromium.org,

Review URL: https://codereview.chromium.org/929043002

Cr-Commit-Position: refs/heads/master@{#316546}
2015-02-17 09:27:05 +00:00
gayane
e170266793 Looking into all changed files to find actions.xml.
In case actions.xml is included in the changelist the chrome/browser/resources/PRESUBMIT.py shouldn't run because the presubmit for actions.xml will do more complete job.

Fixing the bug to look into all changed files in the CL where previously it was only looking at subdirectories of current presubmit script to find actions.xml

BUG=439978

Review URL: https://codereview.chromium.org/760163004

Cr-Commit-Position: refs/heads/master@{#308244}
2014-12-13 03:49:29 +00:00
gayane
860db5c331 Fixing bugs introduced by new presubmit changes
Fixing issues introduced by https://codereview.chromium.org/719463003/.

- Fixing the constant suffix in case of boolean action
- comment fix for mocks.

BUG=439328

TBR=phajdan.jr@chromium.org, brettw@chromium.org

Review URL: https://codereview.chromium.org/757233004

Cr-Commit-Position: refs/heads/master@{#307030}
2014-12-05 16:18:18 +00:00
gayane
3dff8c2676 Presubmit checks for user actions introduced in HTML files.
This presubmit task will catch the case when HTML files are modified with new user action and action.xml is not updated

BUG=431393

Review URL: https://codereview.chromium.org/719463003

Cr-Commit-Position: refs/heads/master@{#306842}
2014-12-04 17:10:50 +00:00