Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 1095943002: DevTools: [console] Logged promise rejections do not change state once handled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: comments addressed Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index 5e1e72ae43da027f7ffe362d168f187b05f4ced1..acca1d94b09fe6d44af60805d64ee7687dfd22c4 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -789,7 +789,8 @@ WebInspector.__defineGetter__("inspectedPageURL", function()
*/
WebInspector.Main.WarningErrorCounter = function()
{
- this._counter = new WebInspector.ToolbarCounter(["error-icon", "warning-icon"]);
+ this._counter = new WebInspector.ToolbarCounter(["error-icon", "revokedError-icon", "warning-icon"]);
+ WebInspector.Main.WarningErrorCounter._instanceForTest = this._counter;
this._counter.addEventListener("click", showConsole);
function showConsole()
@@ -805,14 +806,17 @@ WebInspector.Main.WarningErrorCounter.prototype = {
_updateErrorAndWarningCounts: function()
{
var errors = 0;
+ var revokedErrors = 0;
var warnings = 0;
var targets = WebInspector.targetManager.targets();
for (var i = 0; i < targets.length; ++i) {
- errors = errors + targets[i].consoleModel.errors;
- warnings = warnings + targets[i].consoleModel.warnings;
+ errors += targets[i].consoleModel.errors();
+ revokedErrors += targets[i].consoleModel.revokedErrors();
+ warnings += targets[i].consoleModel.warnings();
}
- this._counter.setCounter("error-icon", errors, WebInspector.UIString(errors > 1 ? "%d errors" : "%d error", errors));
- this._counter.setCounter("warning-icon", warnings, WebInspector.UIString(warnings > 1 ? "%d warnings" : "%d warning", warnings));
+ this._counter.setCounter("error-icon", errors, WebInspector.UIString((!errors || errors > 1) ? "%d errors" : "%d error", errors));
dgozman 2015/04/21 09:16:36 |errors === 0| should hide the counter, there is n
pfeldman 2015/04/21 12:15:27 How would I know that it hides it? I'll still appl
+ this._counter.setCounter("revokedError-icon", revokedErrors, WebInspector.UIString((!revokedErrors || revokedErrors > 1) ? "%d handled promise rejections" : "%d handled promise rejection", revokedErrors));
+ this._counter.setCounter("warning-icon", warnings, WebInspector.UIString((!warnings || warnings > 1) ? "%d warnings" : "%d warning", warnings));
WebInspector.inspectorView.toolbarItemResized();
},

Powered by Google App Engine
This is Rietveld 408576698