Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: LayoutTests/http/tests/fetch/PRESUBMIT.py

Issue 806513004: Add a simple fetch API test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/fetch/README » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 '''Chromium presubmit script for fetch API layout tests. 5 '''Chromium presubmit script for fetch API layout tests.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts. 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts.
8 ''' 8 '''
9 9
10 import os 10 import os
11 import os.path 11 import os.path
12 import re 12 import re
13 13
14 14
15 def missing_files(scripts_path, top_path, worker_path): 15 def missing_files(scripts_path, top_path, worker_path):
16 for script in os.listdir(scripts_path): 16 for script in os.listdir(scripts_path):
17 if script.startswith('.') or not script.endswith('.js'):
18 continue
17 basename = re.sub(r'\.js$', '.html', os.path.basename(script)) 19 basename = re.sub(r'\.js$', '.html', os.path.basename(script))
18 window_path = os.path.join(top_path, basename) 20 for path in [os.path.join(top_path, basename),
19 worker_path = os.path.join(worker_path, basename) 21 os.path.join(worker_path, basename)]:
20 for path in [window_path, worker_path]:
21 if not os.path.exists(path): 22 if not os.path.exists(path):
22 yield path 23 yield path
23 24
24 25
25 def CheckChangeOnUpload(input, output): 26 def CheckChangeOnUpload(input, output):
26 top_path = input.PresubmitLocalPath() 27 top_path = input.PresubmitLocalPath()
27 worker_path = os.path.join(top_path, 'workers') 28 worker_path = os.path.join(top_path, 'workers')
28 script_tests_path = os.path.join(top_path, 'script-tests') 29 script_tests_path = os.path.join(top_path, 'script-tests')
29 30
30 return [output.PresubmitPromptWarning('%s is missing' % path) for path 31 return [output.PresubmitPromptWarning('%s is missing' % path) for path
31 in missing_files(script_tests_path, top_path, worker_path)] 32 in missing_files(script_tests_path, top_path, worker_path)]
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/fetch/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698