Commit b9df2126 authored by Nasko Oskov's avatar Nasko Oskov Committed by Commit Bot

Add eslint and closure compile support for chrome://process-internals.

Bug: 850087
Change-Id: If9f76424b0c2574c67e2a1ed24f3029dfbd798c6
Reviewed-on: https://chromium-review.googlesource.com/c/1268658Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599688}
parent b10b8f33
......@@ -8,6 +8,7 @@ if (closure_compile) {
group("closure_compile") {
deps = [
"histograms:closure_compile",
"process:closure_compile",
]
}
}
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for files in content/browser/resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
def CheckHtml(input_api, output_api):
return input_api.canned_checks.CheckLongLines(
input_api, output_api, 80, lambda x: x.LocalPath().endswith('.html'))
def _CheckWebDevStyle(input_api, output_api):
results = []
try:
import sys
old_sys_path = sys.path[:]
cwd = input_api.PresubmitLocalPath()
sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')]
import web_dev_style.presubmit_support
results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api)
finally:
sys.path = old_sys_path
return results
def _CheckChangeOnUploadOrCommit(input_api, output_api):
results = []
affected = input_api.AffectedFiles()
if any(f for f in affected if f.LocalPath().endswith('.html')):
results += CheckHtml(input_api, output_api)
results += _CheckWebDevStyle(input_api, output_api)
results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api,
check_js=True)
return results
def CheckChangeOnUpload(input_api, output_api):
return _CheckChangeOnUploadOrCommit(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return _CheckChangeOnUploadOrCommit(input_api, output_api)
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module.exports = {
'env': {
'browser': true,
'es6': true,
},
'rules': {
'no-var': 'error',
},
};
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
":process_internals",
]
}
js_library("process_internals") {
deps = [
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js/cr/ui:tree",
]
extra_deps = [
"//content/browser/process_internals:mojo_bindings_js",
"//url/mojom:url_mojom_gurl_js",
]
externs_list = [
"$root_gen_dir/content/browser/process_internals/process_internals.mojom.externs.js",
"$root_gen_dir/url/mojom/url.mojom.externs.js",
"$externs_path/mojo.js",
]
}
......@@ -117,7 +117,7 @@ function frameToTreeItem(frame) {
* Initialize and return a tree item representing the WebContentsInfo object
* and contains all frames in it as a subtree.
* @param {mojom.WebContentsInfo} webContents
* @return {cr.ui.TreeItem}
* @return {!cr.ui.TreeItem}
*/
function webContentsToTreeItem(webContents) {
let itemLabel = 'WebContents: ';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment