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

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

Issue 2238003002: DevTools: migrate sources panel sidebar to views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 4 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 InspectorTest.resumeExecution = function(callback) 167 InspectorTest.resumeExecution = function(callback)
168 { 168 {
169 if (WebInspector.panels.sources.paused()) 169 if (WebInspector.panels.sources.paused())
170 WebInspector.panels.sources._togglePause(); 170 WebInspector.panels.sources._togglePause();
171 InspectorTest.waitUntilResumed(callback); 171 InspectorTest.waitUntilResumed(callback);
172 }; 172 };
173 173
174 InspectorTest.waitUntilPausedAndDumpStackAndResume = function(callback, options) 174 InspectorTest.waitUntilPausedAndDumpStackAndResume = function(callback, options)
175 { 175 {
176 InspectorTest.waitUntilPaused(paused); 176 InspectorTest.waitUntilPaused(paused);
177 InspectorTest.addSniffer(WebInspector.CallStackSidebarPane.prototype, "setSt atus", setStatus); 177 InspectorTest.addSniffer(WebInspector.CallStackSidebarPane.prototype, "_upda teStatusMessage", setStatus);
178 178
179 var caption; 179 var caption;
180 var callFrames; 180 var callFrames;
181 var asyncStackTrace; 181 var asyncStackTrace;
182 182
183 function setStatus(status) 183 function setStatus()
184 { 184 {
185 if (typeof status === "string") 185 caption = this.contentElement.lastChild.deepTextContent();
186 caption = status;
187 else
188 caption = status.deepTextContent();
189 if (callFrames) 186 if (callFrames)
190 step1(); 187 step1();
191 } 188 }
192 189
193 function paused(frames, reason, breakpointIds, async) 190 function paused(frames, reason, breakpointIds, async)
194 { 191 {
195 callFrames = frames; 192 callFrames = frames;
196 asyncStackTrace = async; 193 asyncStackTrace = async;
197 if (typeof caption === "string") 194 if (typeof caption === "string")
198 step1(); 195 step1();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 345
349 InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointId s, asyncStackTrace) 346 InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointId s, asyncStackTrace)
350 { 347 {
351 if (!InspectorTest._quiet) 348 if (!InspectorTest._quiet)
352 InspectorTest.addResult("Script execution paused."); 349 InspectorTest.addResult("Script execution paused.");
353 var debuggerModel = WebInspector.DebuggerModel.fromTarget(this.target()); 350 var debuggerModel = WebInspector.DebuggerModel.fromTarget(this.target());
354 InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame .fromPayloadArray(debuggerModel, callFrames), reason, breakpointIds, asyncStackT race, auxData]; 351 InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame .fromPayloadArray(debuggerModel, callFrames), reason, breakpointIds, asyncStackT race, auxData];
355 if (InspectorTest._waitUntilPausedCallback) { 352 if (InspectorTest._waitUntilPausedCallback) {
356 var callback = InspectorTest._waitUntilPausedCallback; 353 var callback = InspectorTest._waitUntilPausedCallback;
357 delete InspectorTest._waitUntilPausedCallback; 354 delete InspectorTest._waitUntilPausedCallback;
358 callback.apply(callback, InspectorTest._pausedScriptArguments); 355 setTimeout(() => callback.apply(callback, InspectorTest._pausedScriptArg uments));
359 } 356 }
360 }; 357 };
361 358
362 InspectorTest._resumedScript = function() 359 InspectorTest._resumedScript = function()
363 { 360 {
364 if (!InspectorTest._quiet) 361 if (!InspectorTest._quiet)
365 InspectorTest.addResult("Script execution resumed."); 362 InspectorTest.addResult("Script execution resumed.");
366 delete InspectorTest._pausedScriptArguments; 363 delete InspectorTest._pausedScriptArguments;
367 if (InspectorTest._waitUntilResumedCallback) { 364 if (InspectorTest._waitUntilResumedCallback) {
368 var callback = InspectorTest._waitUntilResumedCallback; 365 var callback = InspectorTest._waitUntilResumedCallback;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 sourceFrame._setBreakpoint(lineNumber, 0, condition, enabled); 411 sourceFrame._setBreakpoint(lineNumber, 0, condition, enabled);
415 }; 412 };
416 413
417 InspectorTest.removeBreakpoint = function(sourceFrame, lineNumber) 414 InspectorTest.removeBreakpoint = function(sourceFrame, lineNumber)
418 { 415 {
419 sourceFrame._breakpointManager.findBreakpointOnLine(sourceFrame._uiSourceCod e, lineNumber).remove(); 416 sourceFrame._breakpointManager.findBreakpointOnLine(sourceFrame._uiSourceCod e, lineNumber).remove();
420 }; 417 };
421 418
422 InspectorTest.dumpBreakpointSidebarPane = function(title) 419 InspectorTest.dumpBreakpointSidebarPane = function(title)
423 { 420 {
424 var paneElement = WebInspector.panels.sources.sidebarPanes.jsBreakpoints.lis tElement; 421 var paneElement = self.runtime.sharedInstance(WebInspector.JavaScriptBreakpo intsSidebarPane).element;
425 InspectorTest.addResult("Breakpoint sidebar pane " + (title || "")); 422 InspectorTest.addResult("Breakpoint sidebar pane " + (title || ""));
426 InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElement) ); 423 InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElement) );
427 }; 424 };
428 425
429 InspectorTest.dumpScopeVariablesSidebarPane = function() 426 InspectorTest.dumpScopeVariablesSidebarPane = function()
430 { 427 {
431 InspectorTest.addResult("Scope variables sidebar pane:"); 428 InspectorTest.addResult("Scope variables sidebar pane:");
432 var sections = InspectorTest.scopeChainSections(); 429 var sections = InspectorTest.scopeChainSections();
433 for (var i = 0; i < sections.length; ++i) { 430 for (var i = 0; i < sections.length; ++i) {
434 var textContent = InspectorTest.textContentWithLineBreaks(sections[i].el ement); 431 var textContent = InspectorTest.textContentWithLineBreaks(sections[i].el ement);
435 var text = InspectorTest.clearSpecificInfoFromStackFrames(textContent); 432 var text = InspectorTest.clearSpecificInfoFromStackFrames(textContent);
436 if (text.length > 0) 433 if (text.length > 0)
437 InspectorTest.addResult(text); 434 InspectorTest.addResult(text);
438 if (!sections[i].objectTreeElement().expanded) 435 if (!sections[i].objectTreeElement().expanded)
439 InspectorTest.addResult(" <section collapsed>"); 436 InspectorTest.addResult(" <section collapsed>");
440 } 437 }
441 }; 438 };
442 439
443 InspectorTest.scopeChainSections = function() 440 InspectorTest.scopeChainSections = function()
444 { 441 {
445 var children = WebInspector.panels.sources.sidebarPanes.scopechain.contentEl ement.children; 442 var children = self.runtime.sharedInstance(WebInspector.ScopeChainSidebarPan e).contentElement.children;
446 var sections = []; 443 var sections = [];
447 for (var i = 0; i < children.length; ++i) 444 for (var i = 0; i < children.length; ++i)
448 sections.push(children[i]._section); 445 sections.push(children[i]._section);
449 446
450 return sections; 447 return sections;
451 } 448 }
452 449
453 InspectorTest.expandScopeVariablesSidebarPane = function(callback) 450 InspectorTest.expandScopeVariablesSidebarPane = function(callback)
454 { 451 {
455 // Expand all but the global scope. Expanding global scope takes for too lon g so we keep it collapsed. 452 // Expand all but the global scope. Expanding global scope takes for too lon g so we keep it collapsed.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 576
580 function contextCreated() 577 function contextCreated()
581 { 578 {
582 target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events .ExecutionContextCreated, contextCreated); 579 target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events .ExecutionContextCreated, contextCreated);
583 callback(target.runtimeModel.executionContexts()[0]); 580 callback(target.runtimeModel.executionContexts()[0]);
584 } 581 }
585 } 582 }
586 583
587 InspectorTest.selectThread = function(target) 584 InspectorTest.selectThread = function(target)
588 { 585 {
589 var threadsPane = WebInspector.panels.sources.sidebarPanes.threads; 586 var threadsPane = self.runtime.sharedInstance(WebInspector.ThreadsSidebarPan e);
590 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg erModel.fromTarget(target)); 587 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg erModel.fromTarget(target));
591 threadsPane._onListItemClick(listItem); 588 threadsPane._onListItemClick(listItem);
592 } 589 }
593 590
594 InspectorTest.evaluateOnCurrentCallFrame = function(code) 591 InspectorTest.evaluateOnCurrentCallFrame = function(code)
595 { 592 {
596 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) ); 593 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) );
597 } 594 }
598 595
599 }; 596 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698