OLD | NEW |
1 # Copyright (C) 2014 Google Inc. All rights reserved. | 1 # Copyright (C) 2014 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 # FIXME: The compilation does not actually run if injected script-related fi
les | 42 # FIXME: The compilation does not actually run if injected script-related fi
les |
43 # have changed, as they reside in core/inspector, which is not affected | 43 # have changed, as they reside in core/inspector, which is not affected |
44 # by this presubmit. | 44 # by this presubmit. |
45 # Once this is fixed, InjectedScriptHost.idl and JavaScriptCallFrame.idl | 45 # Once this is fixed, InjectedScriptHost.idl and JavaScriptCallFrame.idl |
46 # should be added to the list of triggers. | 46 # should be added to the list of triggers. |
47 devtools_front_end = input_api.os_path.join("devtools", "front_end") | 47 devtools_front_end = input_api.os_path.join("devtools", "front_end") |
48 if (any(devtools_front_end in path for path in local_paths) or | 48 if (any(devtools_front_end in path for path in local_paths) or |
49 any("protocol.json" in path for path in local_paths) or | 49 any("protocol.json" in path for path in local_paths) or |
50 any("compile_frontend.py" in path for path in local_paths) or | 50 any("compile_frontend.py" in path for path in local_paths) or |
51 any("InjectedScriptSource.js" in path for path in local_paths) or | 51 any("InjectedScriptSource.js" in path for path in local_paths)): |
52 any("InjectedScriptCanvasModuleSource.js" in path for path in local_path
s)): | |
53 lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | 52 lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), |
54 "scripts", "compile_frontend.py") | 53 "scripts", "compile_frontend.py") |
55 out, _ = input_api.subprocess.Popen( | 54 out, _ = input_api.subprocess.Popen( |
56 [input_api.python_executable, lint_path], | 55 [input_api.python_executable, lint_path], |
57 stdout=input_api.subprocess.PIPE, | 56 stdout=input_api.subprocess.PIPE, |
58 stderr=input_api.subprocess.STDOUT).communicate() | 57 stderr=input_api.subprocess.STDOUT).communicate() |
59 if "ERROR" in out or "WARNING" in out: | 58 if "ERROR" in out or "WARNING" in out: |
60 return [output_api.PresubmitError(out)] | 59 return [output_api.PresubmitError(out)] |
61 if "NOTE" in out: | 60 if "NOTE" in out: |
62 return [output_api.PresubmitPromptWarning(out + compile_note)] | 61 return [output_api.PresubmitPromptWarning(out + compile_note)] |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 def CheckChangeOnUpload(input_api, output_api): | 117 def CheckChangeOnUpload(input_api, output_api): |
119 results = [] | 118 results = [] |
120 results.extend(_CompileDevtoolsFrontend(input_api, output_api)) | 119 results.extend(_CompileDevtoolsFrontend(input_api, output_api)) |
121 results.extend(_CheckConvertSVGToPNGHashes(input_api, output_api)) | 120 results.extend(_CheckConvertSVGToPNGHashes(input_api, output_api)) |
122 results.extend(_CheckOptimizePNGHashes(input_api, output_api)) | 121 results.extend(_CheckOptimizePNGHashes(input_api, output_api)) |
123 return results | 122 return results |
124 | 123 |
125 | 124 |
126 def CheckChangeOnCommit(input_api, output_api): | 125 def CheckChangeOnCommit(input_api, output_api): |
127 return [] | 126 return [] |
OLD | NEW |