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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/debugger-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 function scheduleTestFunction() 1 function scheduleTestFunction()
2 { 2 {
3 setTimeout(testFunction, 0); 3 setTimeout(testFunction, 0);
4 } 4 }
5 5
6 var initialize_DebuggerTest = function() { 6 var initialize_DebuggerTest = function() {
7 7
8 InspectorTest.preloadPanel("sources"); 8 InspectorTest.preloadPanel("sources");
9 9
10 InspectorTest.startDebuggerTest = function(callback, quiet) 10 InspectorTest.startDebuggerTest = function(callback, quiet)
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 callFrames = frames; 179 callFrames = frames;
180 asyncStackTrace = async; 180 asyncStackTrace = async;
181 if (typeof caption === "string") 181 if (typeof caption === "string")
182 step1(); 182 step1();
183 } 183 }
184 184
185 function step1() 185 function step1()
186 { 186 {
187 InspectorTest.captureStackTrace(callFrames, asyncStackTrace, options); 187 InspectorTest.captureStackTrace(callFrames, asyncStackTrace, options);
188 InspectorTest.addResult(InspectorTest.clearSpecificInfoFromStackFrames(c aption)); 188 InspectorTest.addResult(InspectorTest.clearSpecificInfoFromStackFrames(c aption));
189 InspectorTest.runAfterPendingDispatches(step2); 189 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
190 } 190 }
191 191
192 function step2() 192 function step2()
193 { 193 {
194 InspectorTest.resumeExecution(InspectorTest.safeWrap(callback)); 194 InspectorTest.resumeExecution(InspectorTest.safeWrap(callback));
195 } 195 }
196 }; 196 };
197 197
198 InspectorTest.stepOver = function() 198 InspectorTest.stepOver = function()
199 { 199 {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 return sections; 436 return sections;
437 } 437 }
438 438
439 InspectorTest.expandScopeVariablesSidebarPane = function(callback) 439 InspectorTest.expandScopeVariablesSidebarPane = function(callback)
440 { 440 {
441 // Expand all but the global scope. Expanding global scope takes for too lon g so we keep it collapsed. 441 // Expand all but the global scope. Expanding global scope takes for too lon g so we keep it collapsed.
442 var sections = InspectorTest.scopeChainSections(); 442 var sections = InspectorTest.scopeChainSections();
443 for (var i = 0; i < sections.length - 1; ++i) 443 for (var i = 0; i < sections.length - 1; ++i)
444 sections[i].expand(); 444 sections[i].expand();
445 InspectorTest.runAfterPendingDispatches(callback); 445 InspectorTest.deprecatedRunAfterPendingDispatches(callback);
446 }; 446 };
447 447
448 InspectorTest.expandProperties = function(properties, callback) 448 InspectorTest.expandProperties = function(properties, callback)
449 { 449 {
450 var index = 0; 450 var index = 0;
451 function expandNextPath() 451 function expandNextPath()
452 { 452 {
453 if (index === properties.length) { 453 if (index === properties.length) {
454 InspectorTest.safeWrap(callback)(); 454 InspectorTest.safeWrap(callback)();
455 return; 455 return;
456 } 456 }
457 var parentTreeElement = properties[index++]; 457 var parentTreeElement = properties[index++];
458 var path = properties[index++]; 458 var path = properties[index++];
459 InspectorTest._expandProperty(parentTreeElement, path, 0, expandNextPath ); 459 InspectorTest._expandProperty(parentTreeElement, path, 0, expandNextPath );
460 } 460 }
461 InspectorTest.runAfterPendingDispatches(expandNextPath); 461 InspectorTest.deprecatedRunAfterPendingDispatches(expandNextPath);
462 }; 462 };
463 463
464 InspectorTest._expandProperty = function(parentTreeElement, path, pathIndex, cal lback) 464 InspectorTest._expandProperty = function(parentTreeElement, path, pathIndex, cal lback)
465 { 465 {
466 if (pathIndex === path.length) { 466 if (pathIndex === path.length) {
467 InspectorTest.addResult("Expanded property: " + path.join(".")); 467 InspectorTest.addResult("Expanded property: " + path.join("."));
468 callback(); 468 callback();
469 return; 469 return;
470 } 470 }
471 var name = path[pathIndex++]; 471 var name = path[pathIndex++];
472 var propertyTreeElement = InspectorTest._findChildPropertyTreeElement(parent TreeElement, name); 472 var propertyTreeElement = InspectorTest._findChildPropertyTreeElement(parent TreeElement, name);
473 if (!propertyTreeElement) { 473 if (!propertyTreeElement) {
474 InspectorTest.addResult("Failed to expand property: " + path.slice(0, pat hIndex).join(".")); 474 InspectorTest.addResult("Failed to expand property: " + path.slice(0, pat hIndex).join("."));
475 InspectorTest.completeDebuggerTest(); 475 InspectorTest.completeDebuggerTest();
476 return; 476 return;
477 } 477 }
478 propertyTreeElement.expand(); 478 propertyTreeElement.expand();
479 InspectorTest.runAfterPendingDispatches(InspectorTest._expandProperty.bind(I nspectorTest, propertyTreeElement, path, pathIndex, callback)); 479 InspectorTest.deprecatedRunAfterPendingDispatches(InspectorTest._expandPrope rty.bind(InspectorTest, propertyTreeElement, path, pathIndex, callback));
480 }; 480 };
481 481
482 InspectorTest._findChildPropertyTreeElement = function(parent, childName) 482 InspectorTest._findChildPropertyTreeElement = function(parent, childName)
483 { 483 {
484 var children = parent.children(); 484 var children = parent.children();
485 for (var i = 0; i < children.length; i++) { 485 for (var i = 0; i < children.length; i++) {
486 var treeElement = children[i]; 486 var treeElement = children[i];
487 var property = treeElement.property; 487 var property = treeElement.property;
488 if (property.name === childName) 488 if (property.name === childName)
489 return treeElement; 489 return treeElement;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg erModel.fromTarget(target)); 576 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg erModel.fromTarget(target));
577 threadsPane._onListItemClick(listItem); 577 threadsPane._onListItemClick(listItem);
578 } 578 }
579 579
580 InspectorTest.evaluateOnCurrentCallFrame = function(code) 580 InspectorTest.evaluateOnCurrentCallFrame = function(code)
581 { 581 {
582 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) ); 582 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) );
583 } 583 }
584 584
585 }; 585 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698