Skip to content

Commit

Permalink
squash 'resources/unpacked/devtools' changes from 8f5fe51..f044be5
Browse files Browse the repository at this point in the history
f044be5 DevTools: Add setting to toggle default mouse wheel scroll/zoom flamechart behavior.
ceced39 DevTools: support object destructuring in pretty print
8ecaab1 DevTools: Fix isCaretAtEndOfPrompt if ghost text is visible
89b7146 DevTools: remove stray error messages while devtools on devtools.
9a11b0d DevTools: Avoid reflow when selecting items in TreeOutline
29c0f8f ChromeDriver: Handle key events properly on Mac
daf5c5e DevTools: add use strict in check gn
39dc3c9 DevTools: Account for border when measuring StylesSidebarPane section
be7df7e DevTools: Clean up selection
26630bd DevTools: Make the performance recording 'Stop' button default.
49541bc Revert "DevTools: remove stray error messages while devtools on devtools."
42660a4 DevTools: migrate ComputedStyleWidget to shadow
312df77 DevTools: Promisify searchInContent calls.
f3c2a82 DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping
ea2a4d8 DevTools: remove stray error messages while devtools on devtools.
7ac8e75 Timeline: fix saving when switching models trough history dialog
44b1ff8 DevTools: check BUILD.gn file as part of PRESUBMIT
8a42b07 Added refresh button to category view of cache storage and indexeddb
74345fa Right-click 'Refresh' on database now updates object store view, also fixed IndexedDB view crash.
fd95b42 DevTools: remove UIString.capitalize.
1f347da DevTools: Avoid a race in WorkspaceDiff when UISourceCodes are removed
6b26576 Revert of [DevTools] Show icon in top toolbar when Node target is available (patchset #3 id:40001 of https://codereview.chromium.org/2890973002/ )
514aac9 DevTools: Limit screenshot overview popover height.
3bb3592 DevTools: migrate MetricsSidebarPane to shadow
573c227 DevTools: reveal and highlight dom nodes when searching in elements panel.
ba9bc87 DevTools: Extract formatter module
6c19df3 DevTools: rename Multimap.(remove|removeAll) into delete and deleteAll
9da32f8 DevTools: migrate SSP Classes and ElementState toolbar widgets to shadow
87b2fbd DevTools: make EventListenersView a proper widget
a552498 DevTools: fix offset condition in console viewport _selectedText and add tests
3c20bd7 DevTools: Add close button to Audits2 dialog
68603e6 DevTools: linkify terminal errors in the term extension.
5b62640 DevTools: Promisify domains clean up

git-subtree-dir: resources/unpacked/devtools
git-subtree-split: f044be5
  • Loading branch information
darwin committed Jun 10, 2017
1 parent faf51da commit 699cf5a
Show file tree
Hide file tree
Showing 142 changed files with 1,559 additions and 1,712 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module.exports = {
"markers": ["*"]
}],
"eqeqeq": [2],
"arrow-body-style": [2, "as-needed"],
"accessor-pairs": [2, {
"getWithoutSet": false,
"setWithoutGet": false
Expand Down
21 changes: 14 additions & 7 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ all_devtools_files = [
"front_end/common/Color.js",
"front_end/common/Console.js",
"front_end/common/ContentProvider.js",
"front_end/common/FormatterWorkerPool.js",
"front_end/common/module.json",
"front_end/common/ModuleExtensionInterfaces.js",
"front_end/common/Object.js",
Expand Down Expand Up @@ -171,22 +170,26 @@ all_devtools_files = [
"front_end/dom_extension/DOMExtension.js",
"front_end/dom_extension/module.json",
"front_end/elements/breadcrumbs.css",
"front_end/elements/classesPaneWidget.css",
"front_end/elements/ClassesPaneWidget.js",
"front_end/elements/ColorSwatchPopoverIcon.js",
"front_end/elements/ComputedStyleModel.js",
"front_end/elements/computedStyleSidebarPane.css",
"front_end/elements/computedStyleWidgetTree.css",
"front_end/elements/ComputedStyleWidget.js",
"front_end/elements/ElementsBreadcrumbs.js",
"front_end/elements/elementsPanel.css",
"front_end/elements/ElementsPanel.js",
"front_end/elements/ElementsSidebarPane.js",
"front_end/elements/elementStatePaneWidget.css",
"front_end/elements/ElementStatePaneWidget.js",
"front_end/elements/ElementsTreeElement.js",
"front_end/elements/ElementsTreeElementHighlighter.js",
"front_end/elements/elementsTreeOutline.css",
"front_end/elements/ElementsTreeOutline.js",
"front_end/elements/EventListenersWidget.js",
"front_end/elements/InspectElementModeController.js",
"front_end/elements/metricsSidebarPane.css",
"front_end/elements/MetricsSidebarPane.js",
"front_end/elements/module.json",
"front_end/elements/platformFontsWidget.css",
Expand Down Expand Up @@ -224,6 +227,9 @@ all_devtools_files = [
"front_end/extensions/ExtensionServer.js",
"front_end/extensions/ExtensionView.js",
"front_end/extensions/module.json",
"front_end/formatter/FormatterWorkerPool.js",
"front_end/formatter/module.json",
"front_end/formatter/ScriptFormatter.js",
"front_end/formatter_worker.js",
"front_end/formatter_worker.json",
"front_end/formatter_worker/AcornTokenizer.js",
Expand Down Expand Up @@ -298,7 +304,6 @@ all_devtools_files = [
"front_end/main/GCActionDelegate.js",
"front_end/main/Main.js",
"front_end/main/module.json",
"front_end/main/nodeIcon.css",
"front_end/main/remoteDebuggingTerminatedScreen.css",
"front_end/main/renderingOptions.css",
"front_end/main/RenderingOptions.js",
Expand Down Expand Up @@ -572,7 +577,6 @@ all_devtools_files = [
"front_end/sources/RevisionHistoryView.js",
"front_end/sources/scopeChainSidebarPane.css",
"front_end/sources/ScopeChainSidebarPane.js",
"front_end/sources/ScriptFormatter.js",
"front_end/sources/ScriptFormatterEditorAction.js",
"front_end/sources/serviceWorkersSidebar.css",
"front_end/sources/SimpleHistoryManager.js",
Expand Down Expand Up @@ -815,7 +819,6 @@ devtools_image_files = [
"front_end/Images/ic_warning_black_18dp.svg",
"front_end/Images/navigationControls.png",
"front_end/Images/navigationControls_2x.png",
"front_end/Images/nodeIcon.png",
"front_end/Images/popoverArrows.png",
"front_end/Images/profileGroupIcon.png",
"front_end/Images/profileIcon.png",
Expand Down Expand Up @@ -860,7 +863,7 @@ generated_scripts = [
"$resources_out_dir/SupportedCSSProperties.js",
]

generated_resources = [
generated_applications = [
"$resources_out_dir/inspector.html",
"$resources_out_dir/inspector.js",
"$resources_out_dir/toolbox.html",
Expand All @@ -869,8 +872,9 @@ generated_resources = [
"$resources_out_dir/formatter_worker.js",
"$resources_out_dir/heap_snapshot_worker.js",
"$resources_out_dir/utility_shared_worker.js",
]

# this contains non-autostart non-remote modules only.
generated_non_autostart_non_remote_modules = [
"$resources_out_dir/animation/animation_module.js",
"$resources_out_dir/audits/audits_module.js",
"$resources_out_dir/audits2/audits2_module.js",
Expand All @@ -885,6 +889,7 @@ generated_resources = [
"$resources_out_dir/diff/diff_module.js",
"$resources_out_dir/elements/elements_module.js",
"$resources_out_dir/event_listeners/event_listeners_module.js",
"$resources_out_dir/formatter/formatter_module.js",
"$resources_out_dir/heap_snapshot_model/heap_snapshot_model_module.js",
"$resources_out_dir/inline_editor/inline_editor_module.js",
"$resources_out_dir/layer_viewer/layer_viewer_module.js",
Expand All @@ -902,13 +907,15 @@ generated_resources = [
"$resources_out_dir/snippets/snippets_module.js",
"$resources_out_dir/source_frame/source_frame_module.js",
"$resources_out_dir/sources/sources_module.js",
"$resources_out_dir/terminal/terminal_module.js",
"$resources_out_dir/text_editor/text_editor_module.js",
"$resources_out_dir/timeline_model/timeline_model_module.js",
"$resources_out_dir/timeline/timeline_module.js",
"$resources_out_dir/workspace_diff/workspace_diff_module.js",
]

generated_resources =
generated_applications + generated_non_autostart_non_remote_modules

generated_remote_modules = [
"$resources_out_dir/accessibility/accessibility_module.js",
"$resources_out_dir/audits2_worker/audits2_worker_module.js",
Expand Down
21 changes: 21 additions & 0 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ def _CheckNodeAndNPMModules(input_api, output_api):
return [output_api.PresubmitNotifyResult(out)]


def _CheckBuildGN(input_api, output_api):
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts")]
import install_node_deps
finally:
sys.path = original_sys_path

node_path, _ = install_node_deps.resolve_node_paths()

script_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "check_gn.js")
process = input_api.subprocess.Popen(
[node_path, script_path], stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
out, _ = process.communicate()

if process.returncode != 0:
return [output_api.PresubmitError(out)]
return [output_api.PresubmitNotifyResult(out)]


def _CheckFormat(input_api, output_api):

def popen(args):
Expand Down Expand Up @@ -185,6 +205,7 @@ def _CheckCSSViolations(input_api, output_api):
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CheckNodeAndNPMModules(input_api, output_api))
results.extend(_CheckBuildGN(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))
Expand Down
Binary file removed front_end/Images/nodeIcon.png
Binary file not shown.
55 changes: 55 additions & 0 deletions front_end/Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,61 @@
step1();
};

TestSuite.prototype.testDispatchKeyEventShowsAutoFill = function() {
var test = this;
var receivedReady = false;

function signalToShowAutofill() {
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'rawKeyDown', key: 'Down', windowsVirtualKeyCode: 40, nativeVirtualKeyCode: 40});
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'keyUp', key: 'Down', windowsVirtualKeyCode: 40, nativeVirtualKeyCode: 40});
}

function selectTopAutoFill() {
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'rawKeyDown', key: 'Down', windowsVirtualKeyCode: 40, nativeVirtualKeyCode: 40});
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'keyUp', key: 'Down', windowsVirtualKeyCode: 40, nativeVirtualKeyCode: 40});
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'rawKeyDown', key: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13});
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'keyUp', key: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13});

test.evaluateInConsole_('document.getElementById("name").value', onResultOfInput);
}

function onResultOfInput(value) {
// Console adds "" around the response.
test.assertEquals('"Abbf"', value);
test.releaseControl();
}

function onConsoleMessage(event) {
var message = event.data.messageText;
if (message === 'ready' && !receivedReady) {
receivedReady = true;
signalToShowAutofill();
}
// This log comes from the browser unittest code.
if (message === 'didShowSuggestions')
selectTopAutoFill();
}

this.takeControl();

// It is possible for the ready console messagage to be already received but not handled
// or received later. This ensures we can catch both cases.
ConsoleModel.consoleModel.addEventListener(ConsoleModel.ConsoleModel.Events.MessageAdded, onConsoleMessage, this);

var messages = ConsoleModel.consoleModel.messages();
if (messages.length) {
var text = messages[0].messageText;
this.assertEquals('ready', text);
signalToShowAutofill();
}
};

TestSuite.prototype.testDispatchKeyEventDoesNotCrash = function() {
SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent(
{type: 'rawKeyDown', windowsVirtualKeyCode: 0x23, key: 'End'});
Expand Down
18 changes: 9 additions & 9 deletions front_end/audits/AuditRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Audits.AuditRules.UnusedCssRule = class extends Audits.AuditRule {
};

/**
* @typedef {!{sourceURL: string, rules: !Array.<!Common.FormatterWorkerPool.CSSStyleRule>}}
* @typedef {!{sourceURL: string, rules: !Array.<!Formatter.FormatterWorkerPool.CSSStyleRule>}}
*/
Audits.AuditRules.ParsedStyleSheet;

Expand Down Expand Up @@ -517,11 +517,11 @@ Audits.AuditRules.StyleSheetProcessor = class {

var allRules = [];
this._currentStyleSheetHeader.requestContent().then(
content => Common.formatterWorkerPool.parseCSS(content || '', onRulesParsed.bind(this)));
content => Formatter.formatterWorkerPool().parseCSS(content || '', onRulesParsed.bind(this)));

/**
* @param {boolean} isLastChunk
* @param {!Array<!Common.FormatterWorkerPool.CSSRule>} rules
* @param {!Array<!Formatter.FormatterWorkerPool.CSSRule>} rules
* @this {Audits.AuditRules.StyleSheetProcessor}
*/
function onRulesParsed(isLastChunk, rules) {
Expand All @@ -532,7 +532,7 @@ Audits.AuditRules.StyleSheetProcessor = class {
}

/**
* @param {!Array.<!Common.FormatterWorkerPool.CSSRule>} rules
* @param {!Array.<!Formatter.FormatterWorkerPool.CSSRule>} rules
*/
_onStyleSheetParsed(rules) {
if (this._progress.isCanceled()) {
Expand Down Expand Up @@ -1205,7 +1205,7 @@ Audits.AuditRules.CSSRuleBase = class extends Audits.AuditRule {

/**
* @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet
* @param {!Common.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Formatter.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Audits.AuditRuleResult} result
*/
_visitRule(styleSheet, rule, result) {
Expand Down Expand Up @@ -1234,7 +1234,7 @@ Audits.AuditRules.CSSRuleBase = class extends Audits.AuditRule {

/**
* @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet
* @param {!Common.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Formatter.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Audits.AuditRuleResult} result
*/
visitRule(styleSheet, rule, result) {
Expand All @@ -1243,7 +1243,7 @@ Audits.AuditRules.CSSRuleBase = class extends Audits.AuditRule {

/**
* @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet
* @param {!Common.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Formatter.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Audits.AuditRuleResult} result
*/
didVisitRule(styleSheet, rule, result) {
Expand All @@ -1252,8 +1252,8 @@ Audits.AuditRules.CSSRuleBase = class extends Audits.AuditRule {

/**
* @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet
* @param {!Common.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Common.FormatterWorkerPool.CSSProperty} property
* @param {!Formatter.FormatterWorkerPool.CSSStyleRule} rule
* @param {!Formatter.FormatterWorkerPool.CSSProperty} property
* @param {!Audits.AuditRuleResult} result
*/
visitProperty(styleSheet, rule, property, result) {
Expand Down
3 changes: 2 additions & 1 deletion front_end/audits/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"components",
"extensions",
"network_log",
"object_ui"
"object_ui",
"formatter"
],
"scripts": [
"AuditsPanel.js",
Expand Down
9 changes: 9 additions & 0 deletions front_end/audits2/Audits2Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
this._dialog.setOutsideClickCallback(event => event.consume(true));
var root = UI.createShadowRootWithCoreStyles(this._dialog.contentElement, 'audits2/audits2Dialog.css');
var auditsViewElement = root.createChild('div', 'audits2-view');

var closeButton = auditsViewElement.createChild('div', 'dialog-close-button', 'dt-close-button');
closeButton.addEventListener('click', () => this._cancelAndClose());

var uiElement = auditsViewElement.createChild('div');
var headerElement = uiElement.createChild('header');
this._headerTitleElement = headerElement.createChild('p');
Expand Down Expand Up @@ -304,6 +308,11 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
delete this._emulationOutlineEnabledBefore;
}

_cancelAndClose() {
this._cancel();
this._hideDialog();
}

_cancel() {
if (this._auditRunning) {
this._updateStatus(Common.UIString('Cancelling\u2026'));
Expand Down
6 changes: 6 additions & 0 deletions front_end/audits2/audits2Dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
align-items: center;
}

.audits2-view .dialog-close-button {
position: absolute;
top: 10px;
right: 10px;
}

header {
color: #666;
font-weight: bold;
Expand Down
20 changes: 2 additions & 18 deletions front_end/bindings/BreakpointManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ Bindings.BreakpointManager = class extends Common.Object {
this._workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this);
this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this);
this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
this._debuggerWorkspaceBinding.addEventListener(
Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this);

targetManager.observeModels(SDK.DebuggerModel, this);
}
Expand Down Expand Up @@ -152,7 +150,7 @@ Bindings.BreakpointManager = class extends Common.Object {
breakpointItem.enabled);
}
}
this._provisionalBreakpoints.removeAll(url);
this._provisionalBreakpoints.deleteAll(url);
this._storage.unmute();
}

Expand All @@ -172,20 +170,6 @@ Bindings.BreakpointManager = class extends Common.Object {
this._removeUISourceCode(uiSourceCode);
}

/**
* @param {!Common.Event} event
*/
_uiSourceCodeMappingChanged(event) {
var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode);
var isIdentity = /** @type {boolean} */ (event.data.isIdentity);
var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data.debuggerModel);
if (isIdentity)
return;
var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || [];
for (var i = 0; i < breakpoints.length; ++i)
breakpoints[i]._updateInDebuggerForModel(debuggerModel);
}

/**
* @param {!Workspace.UISourceCode} uiSourceCode
*/
Expand Down Expand Up @@ -412,7 +396,7 @@ Bindings.BreakpointManager = class extends Common.Object {
breakpoints.remove(breakpoint);
if (removeFromStorage)
this._storage._removeBreakpoint(breakpoint);
this._provisionalBreakpoints.remove(breakpoint._url, breakpoint);
this._provisionalBreakpoints.delete(breakpoint._url, breakpoint);
}

/**
Expand Down
Loading

0 comments on commit 699cf5a

Please sign in to comment.