Skip to content

Commit

Permalink
squash 'resources/unpacked/devtools' changes from 059eb33..e6e277b
Browse files Browse the repository at this point in the history
e6e277b DevTools: Disable tabbed pane on Performance panel experiment by default.
b9dc985 DevTools: create help sub-menu
cfc62a5 DevTools: Only provide static script content to UISourceCode
60ea90b DevTools: Hint about dropping in a folder
3ed37d1 DevTools: Move counters pane before the details pane on timeline.
54e085a DevTools: use git cl format --js for PRESUBMIT check
87160ed DevTools: restore array lengths for long arrays
728c1cc [DevTools] Turn TracingManager into SDKModel.
50c2596 [DevTools] Console should wait for the main target
71e7cdd DevTools: improve design of What's New
ff1abe6 DevTools: fix gutter decorations for formatted scripts
930a427 DevTools: Fixes to Storage panel inconsistencies
d078ae7 DevTools: Remove @unrestricted from StylesSidebarPane.js
a21ef4b DevTools: Template emittable events
e41194f DevTools: Fix empty TextPrompt with placeholder having two lines
e8b60d8 DevTools: render continue-to-location decoration as an arrow.
9030607 [DevTools] Access cpu profiler only when JS capability is present.
926252a DevTools: Restore show panel commands in CommandMenu
0d7e228 DevTools: add CSS/JS type indication to coverage view
dec38c2 [DevTools] Turn starting tracing into promise.
21fc83d Revert of DevTools: create only one uiSourceCode per URL per target. (patchset #5 id:80001 of https://codereview.chromium.org/2714053002/ )
25346e9 [DevTools] Merge SubTargetsManager into TargetManager.

git-subtree-dir: resources/unpacked/devtools
git-subtree-split: e6e277b
  • Loading branch information
darwin committed Mar 2, 2017
1 parent a91b26c commit b6e9db5
Show file tree
Hide file tree
Showing 64 changed files with 1,158 additions and 1,618 deletions.
2 changes: 0 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ all_devtools_files = [
"front_end/sdk/ServiceWorkerCacheModel.js",
"front_end/sdk/ServiceWorkerManager.js",
"front_end/sdk/SourceMap.js",
"front_end/sdk/SubTargetsManager.js",
"front_end/sdk/Target.js",
"front_end/sdk/TargetManager.js",
"front_end/sdk/TracingManager.js",
Expand Down Expand Up @@ -658,7 +657,6 @@ all_devtools_files = [
"front_end/ui/SoftContextMenu.js",
"front_end/ui/splitWidget.css",
"front_end/ui/SplitWidget.js",
"front_end/ui/StackView.js",
"front_end/ui/suggestBox.css",
"front_end/ui/SuggestBox.js",
"front_end/ui/tabbedPane.css",
Expand Down
81 changes: 31 additions & 50 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@
for more details about the presubmit API built into gcl.
"""

from collections import namedtuple
import sys

CheckOutput = namedtuple('CheckOutput', ['results', 'has_errors'])


def _CheckNodeAndNPMModules(input_api, output_api):
node_script_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "install_node_deps.py")
process = input_api.subprocess.Popen(
[input_api.python_executable, node_script_path], stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
out, _ = process.communicate()
if process.returncode != 0:
return CheckOutput([output_api.PresubmitError(out)], has_errors=True)
return CheckOutput([output_api.PresubmitNotifyResult(out)], has_errors=False)
return [output_api.PresubmitError(out)]
return [output_api.PresubmitNotifyResult(out)]


def _CheckFormat(input_api, output_api):

def popen(args):
return input_api.subprocess.Popen(args=args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)

def _FormatDevtools(input_api, output_api):
affected_files = _getAffectedJSFiles(input_api)
if len(affected_files) == 0:
return CheckOutput([], has_errors=False)
return []
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts")]
Expand All @@ -59,39 +60,34 @@ def _FormatDevtools(input_api, output_api):
sys.path = original_sys_path

node_path, _ = install_node_deps.resolve_node_paths()
format_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "format.js")
glob_arg = "--glob=" + ",".join(affected_files)
check_formatting_process = _inputPopen(input_api, args=[node_path, format_path] + [glob_arg, "--output-replacements-xml"])
check_formatting_out, _ = check_formatting_process.communicate()
if check_formatting_process.returncode != 0:
return CheckOutput([output_api.PresubmitError(check_formatting_out)], has_errors=True)
if "</replacement>" not in check_formatting_out:
return CheckOutput([output_api.PresubmitNotifyResult("CL is properly formatted")], has_errors=False)

format_args = [node_path, format_path] + [glob_arg]
format_process = _inputPopen(input_api, format_args)
format_process_out, _ = format_process.communicate()

check_formatting_process = popen(['git', 'cl', 'format', '--js', '--dry-run', input_api.PresubmitLocalPath()])
check_formatting_process.communicate()
if check_formatting_process.returncode == 0:
return []

format_args = ['git', 'cl', 'format', '--js', input_api.PresubmitLocalPath()]
format_process = popen(format_args)
format_out, _ = format_process.communicate()
if format_process.returncode != 0:
return [output_api.PresubmitError(format_out)]

# Use eslint to autofix the braces
eslint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "node_modules", ".bin", "eslint")
eslint_process = _inputPopen(
input_api,
[node_path, eslint_path, '--no-eslintrc', '--fix', '--env=es6', '--rule={"curly": [2, "multi-or-nest", "consistent"]}'] +
affected_files)
eslint_process = popen([
node_path, eslint_path, '--no-eslintrc', '--fix', '--env=es6', '--rule={"curly": [2, "multi-or-nest", "consistent"]}'
] + affected_files)
eslint_process.communicate()

# Need to run clang-format again to align the braces
reformat_process = _inputPopen(input_api, format_args)
reformat_process.communicate()
popen(format_args).communicate()

return CheckOutput(
[
output_api.PresubmitError("ERROR: Found formatting violations.\n"
"Ran clang-format on files changed in CL\n"
"Use git status to check the formatting changes"),
output_api.PresubmitError(format_process_out)
],
has_errors=True)
return [
output_api.PresubmitError("ERROR: Found formatting violations in third_party/WebKit/Source/devtools.\n"
"Ran clang-format on diff\n"
"Use git status to check the formatting changes"),
output_api.PresubmitError(format_out),
]


def _CheckDevtoolsStyle(input_api, output_api):
Expand Down Expand Up @@ -188,19 +184,8 @@ def _CheckCSSViolations(input_api, output_api):

def CheckChangeOnUpload(input_api, output_api):
results = []

(node_results, has_errors) = _CheckNodeAndNPMModules(input_api, output_api)
results.extend(node_results)
if has_errors:
results.append(output_api.PresubmitError("ERROR: Bailed out early because error using node.js/npm"))
return results

(format_results, has_errors) = _FormatDevtools(input_api, output_api)
results.extend(format_results)
if has_errors:
results.append(output_api.PresubmitError("ERROR: Bailed out early because formatting errors were found"))
return results

results.extend(_CheckNodeAndNPMModules(input_api, output_api))
results.extend(_CheckFormat(input_api, output_api))
results.extend(_CheckDevtoolsStyle(input_api, output_api))
results.extend(_CompileDevtoolsFrontend(input_api, output_api))
results.extend(_CheckConvertSVGToPNGHashes(input_api, output_api))
Expand Down Expand Up @@ -233,7 +218,3 @@ def _getAffectedJSFiles(input_api):
if (devtools_front_end in file_name or devtools_scripts in file_name) and file_name.endswith(".js")
]
return [input_api.os_path.relpath(file_name, devtools_root) for file_name in affected_js_files]


def _inputPopen(input_api, args):
return input_api.subprocess.Popen(args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
Binary file modified front_end/Images/smallIcons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified front_end/Images/smallIcons_2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion front_end/Images/src/optimize_png.hashes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28",
"checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a",
"errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45",
"smallIcons.svg": "044ba42204fd8ae030835e2ca78433bf",
"smallIcons.svg": "b8336251749394a04c66de7e4a29e51e",
"toolbarButtonGlyphs.svg": "fa5911823785a90273dfea76fe4ce512",
"breakpoint.svg": "69cd92d807259c022791112809b97799",
"treeoutlineTriangles.svg": "017d2f89437df0afc6b9cd5ff43735d9",
Expand Down
50 changes: 31 additions & 19 deletions front_end/Images/src/smallIcons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion front_end/Images/src/svg2png.hashes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28",
"checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a",
"errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45",
"smallIcons.svg": "044ba42204fd8ae030835e2ca78433bf",
"smallIcons.svg": "b8336251749394a04c66de7e4a29e51e",
"toolbarButtonGlyphs.svg": "fa5911823785a90273dfea76fe4ce512",
"breakpoint.svg": "69cd92d807259c022791112809b97799",
"treeoutlineTriangles.svg": "017d2f89437df0afc6b9cd5ff43735d9",
Expand Down
2 changes: 1 addition & 1 deletion front_end/Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@
var test = this;
this.showPanel('timeline').then(function() {
var timeline = UI.panels.timeline;
test._overrideMethod(timeline, 'recordingStarted', callback);
test._overrideMethod(timeline, '_recordingStarted', callback);
timeline._toggleRecording();
});
};
Expand Down
Loading

0 comments on commit b6e9db5

Please sign in to comment.