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.
5 '''Chromium presubmit script for fetch API layout tests.
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts.
15 def missing_files(scripts_path, path_list):
16 for script in os.listdir(scripts_path):
17 if script.startswith('.') or not script.endswith('.js'):
19 basename = re.sub(r'\.js$', '.html', os.path.basename(script))
20 for path in [os.path.join(path, basename) for path in path_list]:
21 if not os.path.exists(path):
25 def CheckChangeOnUpload(input, output):
26 contexts = ['window', 'workers', 'serviceworker']
28 top_path = input.PresubmitLocalPath()
29 script_tests_path = os.path.join(top_path, 'script-tests')
30 test_paths = [os.path.join(top_path, context) for context in contexts]
32 return [output.PresubmitPromptWarning('%s is missing' % path) for path
33 in missing_files(script_tests_path, test_paths)]
36 # Because generate.py has been quite updated, this PRESUBMIT.py is obsolete
37 # and temporarily disabled.
38 def CheckChangeOnUpload(input, output
):