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

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

Issue 1877223003: DevTools: deprecate InspectorTest.runAfterPendingDispatches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 function listenersArrived() 394 function listenersArrived()
395 { 395 {
396 var listenerTypes = eventListenersView._treeOutline.rootElement().childr en(); 396 var listenerTypes = eventListenersView._treeOutline.rootElement().childr en();
397 for (var i = 0; i < listenerTypes.length; ++i) { 397 for (var i = 0; i < listenerTypes.length; ++i) {
398 listenerTypes[i].expand(); 398 listenerTypes[i].expand();
399 var listenerItems = listenerTypes[i].children(); 399 var listenerItems = listenerTypes[i].children();
400 for (var j = 0; j < listenerItems.length; ++j) 400 for (var j = 0; j < listenerItems.length; ++j)
401 listenerItems[j].expand(); 401 listenerItems[j].expand();
402 } 402 }
403 InspectorTest.runAfterPendingDispatches(objectsExpanded); 403 InspectorTest.deprecatedRunAfterPendingDispatches(objectsExpanded);
404 } 404 }
405 405
406 function objectsExpanded() 406 function objectsExpanded()
407 { 407 {
408 var listenerTypes = eventListenersView._treeOutline.rootElement().childr en(); 408 var listenerTypes = eventListenersView._treeOutline.rootElement().childr en();
409 for (var i = 0; i < listenerTypes.length; ++i) { 409 for (var i = 0; i < listenerTypes.length; ++i) {
410 if (!listenerTypes[i].children().length) 410 if (!listenerTypes[i].children().length)
411 continue; 411 continue;
412 var eventType = listenerTypes[i]._title; 412 var eventType = listenerTypes[i]._title;
413 InspectorTest.addResult(""); 413 InspectorTest.addResult("");
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 var oldCallback = InspectorTest._pageLoadedCallback; 505 var oldCallback = InspectorTest._pageLoadedCallback;
506 function chainedCallback() 506 function chainedCallback()
507 { 507 {
508 if (oldCallback) 508 if (oldCallback)
509 oldCallback(); 509 oldCallback();
510 callback(); 510 callback();
511 } 511 }
512 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(chainedCallback); 512 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(chainedCallback);
513 } 513 }
514 514
515 InspectorTest.runAfterPendingDispatches = function(callback) 515 InspectorTest.deprecatedRunAfterPendingDispatches = function(callback)
516 { 516 {
517 var barrier = new CallbackBarrier(); 517 var barrier = new CallbackBarrier();
518 var targets = WebInspector.targetManager.targets(); 518 var targets = WebInspector.targetManager.targets();
519 for (var i = 0; i < targets.length; ++i) 519 for (var i = 0; i < targets.length; ++i)
520 targets[i]._connection.runAfterPendingDispatches(barrier.createCallback( )); 520 targets[i]._connection.deprecatedRunAfterPendingDispatches(barrier.creat eCallback());
521 barrier.callWhenDone(InspectorTest.safeWrap(callback)); 521 barrier.callWhenDone(InspectorTest.safeWrap(callback));
522 } 522 }
523 523
524 InspectorTest.createKeyEvent = function(keyIdentifier, ctrlKey, altKey, shiftKey , metaKey) 524 InspectorTest.createKeyEvent = function(keyIdentifier, ctrlKey, altKey, shiftKey , metaKey)
525 { 525 {
526 var evt = document.createEvent("KeyboardEvent"); 526 var evt = document.createEvent("KeyboardEvent");
527 evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel * /, null /* view */, keyIdentifier, "", ctrlKey, altKey, shiftKey, metaKey); 527 evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel * /, null /* view */, keyIdentifier, "", ctrlKey, altKey, shiftKey, metaKey);
528 return evt; 528 return evt;
529 } 529 }
530 530
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 _output("[page] " + text); 1205 _output("[page] " + text);
1206 } 1206 }
1207 1207
1208 function _output(result) 1208 function _output(result)
1209 { 1209 {
1210 if (!outputElement) 1210 if (!outputElement)
1211 createOutputElement(); 1211 createOutputElement();
1212 outputElement.appendChild(document.createTextNode(result)); 1212 outputElement.appendChild(document.createTextNode(result));
1213 outputElement.appendChild(document.createElement("br")); 1213 outputElement.appendChild(document.createElement("br"));
1214 } 1214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698