Roll src/third_party/WebKit 57aef96:a1089e6 (svn 201978:201979)
[chromium-blink-merge.git] / net / tools / tld_cleanup / PRESUBMIT.py
blob8391e0e61a131b4a218debfef9e285310ee8b697
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 """Chromium presubmit script for src/net/tools/tld_cleanup."""
9 def _RunMakeDafsaTests(input_api, output_api):
10 """Runs unittest for make_dafsa if any related file has been modified."""
11 files = ('net/tools/tld_cleanup/make_dafsa.py',
12 'net/tools/tld_cleanup/make_dafsa_unittest.py')
13 if not any(f in input_api.LocalPaths() for f in files):
14 return []
15 test_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
16 'make_dafsa_unittest.py')
17 cmd_name = 'make_dafsa_unittest'
18 cmd = [input_api.python_executable, test_path]
19 test_cmd = input_api.Command(
20 name=cmd_name,
21 cmd=cmd,
22 kwargs={},
23 message=output_api.PresubmitPromptWarning)
24 return input_api.RunTests([test_cmd])
27 def CheckChangeOnUpload(input_api, output_api):
28 return _RunMakeDafsaTests(input_api, output_api)
31 def CheckChangeOnCommit(input_api, output_api):
32 return _RunMakeDafsaTests(input_api, output_api)