Commit 1aa78e01 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions WebUI] Remove the "Open in Dev Tools" button on errors

Extension errors have associated renderers, and we half-supported
opening developer tools to that error. Unfortunately, we didn't do this
very well - we didn't watch for renderer destruction or navigation,
either of which invalidate the ability to inspect.

Given the complexity of properly monitoring these, and the limited
utility this feature offered, remove this aspect of the error console.
The stack trace, context, and error should be sufficient to help the
developer track it down.

Bug: 769978
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ie0ae3d07448dc82af97315189313a9fd969b5b14
Reviewed-on: https://chromium-review.googlesource.com/1069564
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560941}
parent acab441f
......@@ -79,9 +79,6 @@
<message name="IDS_MD_EXTENSIONS_A11Y_CLEAR_ENTRY" desc="The accessibility label for the button that clears a single error entry.">
Clear entry
</message>
<message name="IDS_MD_EXTENSIONS_ERROR_LAUNCH_DEVTOOLS" desc="The text for the button to view an extension error in the developer tools.">
View in Developer Tools
</message>
<message name="IDS_MD_EXTENSIONS_ERROR_STACK_TRACE" desc="The label for the stack trace of an extension's error.">
Stack Trace
</message>
......
......@@ -131,11 +131,6 @@
background: var(--google-blue-100);
}
.devtool-button {
margin-bottom: 20px;
max-width: 300px;
}
extensions-code-section {
background: white;
height: 200px;
......@@ -247,12 +242,6 @@
could-not-display-code="$i18n{noErrorsToShow}">
</extensions-code-section>
</template>
<paper-button class="devtool-button action-button"
hidden$="[[!computeIsRuntimeError_(item)]]"
disabled="[[!item.canInspect]]"
on-click="onDevToolButtonTap_">
$i18n{openInDevtool}
</paper-button>
</div>
</iron-collapse>
</div>
......
......@@ -24,11 +24,6 @@ cr.define('extensions', function() {
* @return {!Promise<!chrome.developerPrivate.RequestFileSourceResponse>}
*/
requestFileSource(args) {}
/**
* @param {!chrome.developerPrivate.OpenDevToolsProperties} args
*/
openDevTools(args) {}
}
/**
......@@ -342,22 +337,6 @@ cr.define('extensions', function() {
}
},
/** @private */
onDevToolButtonTap_: function() {
const selectedError = this.getSelectedError();
// This guarantees renderProcessId and renderViewId.
assert(selectedError.type == chrome.developerPrivate.ErrorType.RUNTIME);
assert(this.selectedStackFrame_);
this.delegate.openDevTools({
renderProcessId: selectedError.renderProcessId,
renderViewId: selectedError.renderViewId,
url: this.selectedStackFrame_.url,
lineNumber: this.selectedStackFrame_.lineNumber || 0,
columnNumber: this.selectedStackFrame_.columnNumber || 0,
});
},
/**
* Computes the class name for the error item depending on whether its
* the currently selected error.
......
......@@ -308,11 +308,6 @@ cr.define('extensions', function() {
});
}
/** @override */
openDevTools(args) {
chrome.developerPrivate.openDevTools(args);
}
/** @override */
showInFolder(id) {
chrome.developerPrivate.showPath(id);
......
......@@ -156,7 +156,6 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
{"anonymousFunction", IDS_MD_EXTENSIONS_ERROR_ANONYMOUS_FUNCTION},
{"errorContext", IDS_MD_EXTENSIONS_ERROR_CONTEXT},
{"errorContextUnknown", IDS_MD_EXTENSIONS_ERROR_CONTEXT_UNKNOWN},
{"openInDevtool", IDS_MD_EXTENSIONS_ERROR_LAUNCH_DEVTOOLS},
{"stackTrace", IDS_MD_EXTENSIONS_ERROR_STACK_TRACE},
// TODO(dpapad): Unify with Settings' IDS_SETTINGS_WEB_STORE.
{"openChromeWebStore", IDS_MD_EXTENSIONS_SIDEBAR_OPEN_CHROME_WEB_STORE},
......
......@@ -30,10 +30,6 @@ cr.define('extension_error_page_tests', function() {
this.requestFileSourceResolver = new PromiseResolver();
return this.requestFileSourceResolver.promise;
},
openDevTools: function(args) {
this.openDevToolsArgs = args;
},
};
var suiteName = 'ExtensionErrorPageTest';
......@@ -198,18 +194,6 @@ cr.define('extension_error_page_tests', function() {
expectTrue(ironCollapses[1].opened);
expectFalse(ironCollapses[0].opened);
// Tapping the button sends the right parameter to open dev tool.
expectTrue(
ironCollapses[1].querySelector('li').classList.contains('selected'));
MockInteractions.tap(ironCollapses[1].querySelector('paper-button'));
expectDeepEquals(mockDelegate.openDevToolsArgs, {
renderProcessId: 111,
renderViewId: 222,
url: 'url',
lineNumber: 123,
columnNumber: 321,
});
expectEquals(
'Unknown',
ironCollapses[0].querySelector('.context-url').textContent.trim());
......
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