OLD | NEW |
1 var initialize_InspectorTest = function() { | 1 var initialize_InspectorTest = function() { |
2 | 2 |
3 var results = []; | 3 var results = []; |
4 | 4 |
5 function consoleOutputHook(messageType) | 5 function consoleOutputHook(messageType) |
6 { | 6 { |
7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
8 } | 8 } |
9 | 9 |
10 window._originalConsoleLog = console.log.bind(console); | 10 window._originalConsoleLog = console.log.bind(console); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 if (j) | 338 if (j) |
339 line += " | "; | 339 line += " | "; |
340 line += alignText(textRows[i][j], textWidths[j]); | 340 line += alignText(textRows[i][j], textWidths[j]); |
341 } | 341 } |
342 line += "|"; | 342 line += "|"; |
343 output.push(line); | 343 output.push(line); |
344 } | 344 } |
345 return output.join("\n"); | 345 return output.join("\n"); |
346 } | 346 } |
347 | 347 |
| 348 InspectorTest.dumpEventListeners = function(next, listeners) |
| 349 { |
| 350 for (var i = 0; i < listeners.length; ++i) { |
| 351 delete listeners[i]._location.scriptId; |
| 352 var sourceName = listeners[i]._sourceName; |
| 353 sourceName = sourceName.substr(sourceName.lastIndexOf('/') + 1); |
| 354 listeners[i]._sourceName = sourceName; |
| 355 |
| 356 InspectorTest.addResult("type: " + listeners[i].type()); |
| 357 InspectorTest.addResult("useCapture: " + listeners[i].useCapture()); |
| 358 InspectorTest.addResult("location: " + listeners[i].location().columnNum
ber + ", " + listeners[i].location().lineNumber); |
| 359 InspectorTest.addResult("handler: " + listeners[i].handler().description
); |
| 360 InspectorTest.addResult("handlerType: " + listeners[i].handlerType()); |
| 361 InspectorTest.addResult("sourceName: " + listeners[i].sourceName()); |
| 362 InspectorTest.addResult(""); |
| 363 } |
| 364 next(); |
| 365 } |
| 366 |
348 InspectorTest.assertGreaterOrEqual = function(a, b, message) | 367 InspectorTest.assertGreaterOrEqual = function(a, b, message) |
349 { | 368 { |
350 if (a < b) | 369 if (a < b) |
351 InspectorTest.addResult("FAILED: " + (message ? message + ": " : "") + a
+ " < " + b); | 370 InspectorTest.addResult("FAILED: " + (message ? message + ": " : "") + a
+ " < " + b); |
352 } | 371 } |
353 | 372 |
354 InspectorTest.navigate = function(url, callback) | 373 InspectorTest.navigate = function(url, callback) |
355 { | 374 { |
356 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); | 375 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); |
357 InspectorTest.evaluateInPage("window.location.replace('" + url + "')"); | 376 InspectorTest.evaluateInPage("window.location.replace('" + url + "')"); |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 _output("[page] " + text); | 1088 _output("[page] " + text); |
1070 } | 1089 } |
1071 | 1090 |
1072 function _output(result) | 1091 function _output(result) |
1073 { | 1092 { |
1074 if (!outputElement) | 1093 if (!outputElement) |
1075 createOutputElement(); | 1094 createOutputElement(); |
1076 outputElement.appendChild(document.createTextNode(result)); | 1095 outputElement.appendChild(document.createTextNode(result)); |
1077 outputElement.appendChild(document.createElement("br")); | 1096 outputElement.appendChild(document.createElement("br")); |
1078 } | 1097 } |
OLD | NEW |