| OLD | NEW |
| 1 if (window.GCController) | 1 if (window.GCController) |
| 2 GCController.collectAll(); | 2 GCController.collectAll(); |
| 3 var initialize_InspectorTest = function() { | 3 var initialize_InspectorTest = function() { |
| 4 | 4 |
| 5 var results = []; | 5 var results = []; |
| 6 | 6 |
| 7 function consoleOutputHook(messageType) | 7 function consoleOutputHook(messageType) |
| 8 { | 8 { |
| 9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
| 10 } | 10 } |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 callback(); | 351 callback(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 if (force) | 354 if (force) |
| 355 listenersArrived(); | 355 listenersArrived(); |
| 356 else | 356 else |
| 357 InspectorTest.addSniffer(Components.EventListenersView.prototype, "_even
tListenersArrivedForTest", listenersArrived); | 357 InspectorTest.addSniffer(Components.EventListenersView.prototype, "_even
tListenersArrivedForTest", listenersArrived); |
| 358 } | 358 } |
| 359 | 359 |
| 360 InspectorTest.dumpNavigatorView = function(navigatorView) | 360 InspectorTest.dumpNavigatorView = function(navigatorView, dumpIcons) |
| 361 { | 361 { |
| 362 dumpNavigatorTreeOutline(navigatorView._scriptsTree); | 362 dumpNavigatorTreeOutline(navigatorView._scriptsTree); |
| 363 | 363 |
| 364 function dumpNavigatorTreeElement(prefix, treeElement) | 364 function dumpNavigatorTreeElement(prefix, treeElement) |
| 365 { | 365 { |
| 366 var titleText = treeElement.title; | 366 var titleText = ''; |
| 367 if (treeElement._trailingIconsElement) { | 367 if (treeElement._leadingIconsElement && dumpIcons) { |
| 368 var iconTypes = []; | 368 var iconTypes = []; |
| 369 for (var icon = treeElement._trailingIconsElement.firstChild; icon;
icon = icon.nextSibling) { | 369 for (var icon = treeElement._leadingIconsElement.firstChild; icon; i
con = icon.nextSibling) { |
| 370 iconTypes.push(icon._iconType); | 370 iconTypes.push(extractIconType(icon)); |
| 371 } | 371 } |
| 372 if (iconTypes.length) | 372 if (iconTypes.length) |
| 373 titleText = titleText + " [" + iconTypes.join(", ") + "]"; | 373 titleText = titleText + "[" + iconTypes.join(", ") + "] "; |
| 374 } | 374 } |
| 375 titleText += treeElement.title; |
| 375 if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem ||
treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) { | 376 if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem ||
treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) { |
| 376 var hasMappedFiles = treeElement.listItemElement.classList.contains(
"has-mapped-files"); | 377 var hasMappedFiles = treeElement.listItemElement.classList.contains(
"has-mapped-files"); |
| 377 if (!hasMappedFiles) | 378 if (!hasMappedFiles) |
| 378 titleText += " [dimmed]"; | 379 titleText += " [dimmed]"; |
| 379 } | 380 } |
| 380 InspectorTest.addResult(prefix + titleText); | 381 InspectorTest.addResult(prefix + titleText); |
| 381 treeElement.expand(); | 382 treeElement.expand(); |
| 382 var children = treeElement.children(); | 383 var children = treeElement.children(); |
| 383 for (var i = 0; i < children.length; ++i) | 384 for (var i = 0; i < children.length; ++i) |
| 384 dumpNavigatorTreeElement(prefix + " ", children[i]); | 385 dumpNavigatorTreeElement(prefix + " ", children[i]); |
| 385 } | 386 } |
| 386 | 387 |
| 387 function dumpNavigatorTreeOutline(treeOutline) | 388 function dumpNavigatorTreeOutline(treeOutline) |
| 388 { | 389 { |
| 389 var children = treeOutline.rootElement().children(); | 390 var children = treeOutline.rootElement().children(); |
| 390 for (var i = 0; i < children.length; ++i) | 391 for (var i = 0; i < children.length; ++i) |
| 391 dumpNavigatorTreeElement("", children[i]); | 392 dumpNavigatorTreeElement("", children[i]); |
| 392 } | 393 } |
| 394 |
| 395 function extractIconType(icon) |
| 396 { |
| 397 if (icon.classList.contains('icon-stack')) { |
| 398 var types = []; |
| 399 for (var child = icon.firstChild; child; child = child.nextSibling) |
| 400 types.push(child._iconType); |
| 401 return types.join('+'); |
| 402 } |
| 403 return icon._iconType; |
| 404 } |
| 393 } | 405 } |
| 394 | 406 |
| 395 InspectorTest.dumpNavigatorViewInAllModes = function(view) | 407 InspectorTest.dumpNavigatorViewInAllModes = function(view) |
| 396 { | 408 { |
| 397 ["frame", "frame/domain", "frame/domain/folder", "domain", "domain/folder"].
forEach(InspectorTest.dumpNavigatorViewInMode.bind(InspectorTest, view)); | 409 ["frame", "frame/domain", "frame/domain/folder", "domain", "domain/folder"].
forEach(InspectorTest.dumpNavigatorViewInMode.bind(InspectorTest, view)); |
| 398 } | 410 } |
| 399 | 411 |
| 400 InspectorTest.dumpNavigatorViewInMode = function(view, mode) | 412 InspectorTest.dumpNavigatorViewInMode = function(view, mode) |
| 401 { | 413 { |
| 402 InspectorTest.addResult(view instanceof Sources.SourcesNavigatorView ? "Sour
ces:" : "Content Scripts:"); | 414 InspectorTest.addResult(view instanceof Sources.SourcesNavigatorView ? "Sour
ces:" : "Content Scripts:"); |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 _output("[page] " + text); | 1237 _output("[page] " + text); |
| 1226 } | 1238 } |
| 1227 | 1239 |
| 1228 function _output(result) | 1240 function _output(result) |
| 1229 { | 1241 { |
| 1230 if (!outputElement) | 1242 if (!outputElement) |
| 1231 createOutputElement(); | 1243 createOutputElement(); |
| 1232 outputElement.appendChild(document.createTextNode(result)); | 1244 outputElement.appendChild(document.createTextNode(result)); |
| 1233 outputElement.appendChild(document.createElement("br")); | 1245 outputElement.appendChild(document.createElement("br")); |
| 1234 } | 1246 } |
| OLD | NEW |