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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2594883002: DevTools: [Persistence] introduce badged icons instead of checkmarks (Closed)
Patch Set: missing jsdoc Created 4 years 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: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index 1a20d3f672e16bd1405780e59bad812977a38ac7..0b4b8d3827194a75cf386719e5b09e5ad4123301 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -357,21 +357,22 @@ InspectorTest.expandAndDumpEventListeners = function(eventListenersView, callbac
InspectorTest.addSniffer(Components.EventListenersView.prototype, "_eventListenersArrivedForTest", listenersArrived);
}
-InspectorTest.dumpNavigatorView = function(navigatorView)
+InspectorTest.dumpNavigatorView = function(navigatorView, dumpIcons)
{
dumpNavigatorTreeOutline(navigatorView._scriptsTree);
function dumpNavigatorTreeElement(prefix, treeElement)
{
- var titleText = treeElement.title;
- if (treeElement._trailingIconsElement) {
+ var titleText = '';
+ if (treeElement._leadingIconsElement && dumpIcons) {
var iconTypes = [];
- for (var icon = treeElement._trailingIconsElement.firstChild; icon; icon = icon.nextSibling) {
- iconTypes.push(icon._iconType);
+ for (var icon = treeElement._leadingIconsElement.firstChild; icon; icon = icon.nextSibling) {
+ iconTypes.push(extractIconType(icon));
}
if (iconTypes.length)
- titleText = titleText + " [" + iconTypes.join(", ") + "]";
+ titleText = titleText + "[" + iconTypes.join(", ") + "] ";
}
+ titleText += treeElement.title;
if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem || treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) {
var hasMappedFiles = treeElement.listItemElement.classList.contains("has-mapped-files");
if (!hasMappedFiles)
@@ -390,6 +391,17 @@ InspectorTest.dumpNavigatorView = function(navigatorView)
for (var i = 0; i < children.length; ++i)
dumpNavigatorTreeElement("", children[i]);
}
+
+ function extractIconType(icon)
+ {
+ if (icon.classList.contains('icon-stack')) {
+ var types = [];
+ for (var child = icon.firstChild; child; child = child.nextSibling)
+ types.push(child._iconType);
+ return types.join('+');
+ }
+ return icon._iconType;
+ }
}
InspectorTest.dumpNavigatorViewInAllModes = function(view)

Powered by Google App Engine
This is Rietveld 408576698