Commit f4751993 authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[NTP] Add PRESUBMIT.py for local_ntp/

Add presubmit that checks for changes to local_ntp.html that don't
also include changes to local_ntp_browsertest.html.

Bug: None
Change-Id: I5ab07a46800d4a9fdac2fd7978fe250a4a0bdf22
Reviewed-on: https://chromium-review.googlesource.com/c/1477769
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634344}
parent cc7fa1a2
# Copyright 2019 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.
'Presubmit script for changes affecting chrome/browser/resources/local_ntp/'
def NTPPresubmitChecks(input_api, output_api):
affected = input_api.change.AffectedFiles()
warning_str = ('Test HTML files in chrome/test/data/local_ntp/ should be '
'updated when making changes to local_ntp.html');
if (any(f for f in affected if
f.LocalPath().endswith('local_ntp.html')) and
not any(f for f in affected if
f.LocalPath().endswith('local_ntp_browsertest.html'))):
return [output_api.PresubmitPromptWarning(warning_str)]
return []
def CheckChangeOnUpload(input_api, output_api):
return NTPPresubmitChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return NTPPresubmitChecks(input_api, output_api)
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
<meta name="google" value="notranslate"> <meta name="google" value="notranslate">
<meta name="referrer" content="strict-origin"> <meta name="referrer" content="strict-origin">
</head> </head>
<!-- Remember to update the test HTML files in chrome/test/data/local_ntp/
whenever making changes to this file.-->
<body> <body>
<div id="custom-bg"></div> <div id="custom-bg"></div>
<!-- Container for the OneGoogleBar HTML. --> <!-- Container for the OneGoogleBar HTML. -->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment