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

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

Issue 2505413002: [DevTools] Prepare JavaScriptSourceFrame for multiple breakpoints per line (Closed)
Patch Set: added test for decorations, edit one is coming Created 4 years, 1 month 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 { 418 {
419 if (!sourceFrame._muted) 419 if (!sourceFrame._muted)
420 sourceFrame._setBreakpoint(lineNumber, 0, condition, enabled); 420 sourceFrame._setBreakpoint(lineNumber, 0, condition, enabled);
421 }; 421 };
422 422
423 InspectorTest.removeBreakpoint = function(sourceFrame, lineNumber) 423 InspectorTest.removeBreakpoint = function(sourceFrame, lineNumber)
424 { 424 {
425 sourceFrame._breakpointManager.findBreakpoints(sourceFrame._uiSourceCode, li neNumber)[0].remove(); 425 sourceFrame._breakpointManager.findBreakpoints(sourceFrame._uiSourceCode, li neNumber)[0].remove();
426 }; 426 };
427 427
428 InspectorTest.createNewBreakpoint = function(sourceFrame, lineNumber, condition, enabled)
429 {
430 sourceFrame._createNewBreakpoint(lineNumber, condition, enabled);
431 }
432
433 InspectorTest.toggleBreakpoint = function(sourceFrame, lineNumber, disableOnly)
434 {
435 if (!sourceFrame._muted)
436 sourceFrame._toggleBreakpoint(lineNumber, disableOnly);
437 };
438
428 InspectorTest.waitBreakpointSidebarPane = function() 439 InspectorTest.waitBreakpointSidebarPane = function()
429 { 440 {
430 return new Promise(resolve => InspectorTest.addSniffer(Sources.JavaScriptBre akpointsSidebarPane.prototype, "_didUpdateForTest", resolve)); 441 return new Promise(resolve => InspectorTest.addSniffer(Sources.JavaScriptBre akpointsSidebarPane.prototype, "_didUpdateForTest", resolve));
431 } 442 }
432 443
433 InspectorTest.breakpointsSidebarPaneContent = function() 444 InspectorTest.breakpointsSidebarPaneContent = function()
434 { 445 {
435 var paneElement = self.runtime.sharedInstance(Sources.JavaScriptBreakpointsS idebarPane).contentElement; 446 var paneElement = self.runtime.sharedInstance(Sources.JavaScriptBreakpointsS idebarPane).contentElement;
436 var empty = paneElement.querySelector('.gray-info-message'); 447 var empty = paneElement.querySelector('.gray-info-message');
437 if (empty) 448 if (empty)
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 var threadsPane = self.runtime.sharedInstance(Sources.ThreadsSidebarPane); 620 var threadsPane = self.runtime.sharedInstance(Sources.ThreadsSidebarPane);
610 var listItem = threadsPane._listItemForTarget(target); 621 var listItem = threadsPane._listItemForTarget(target);
611 threadsPane._onListItemClick(listItem); 622 threadsPane._onListItemClick(listItem);
612 } 623 }
613 624
614 InspectorTest.evaluateOnCurrentCallFrame = function(code) 625 InspectorTest.evaluateOnCurrentCallFrame = function(code)
615 { 626 {
616 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) ); 627 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ)) );
617 } 628 }
618 629
630 InspectorTest.waitJavaScriptSourceFrameBreakpoints = function(sourceFrame)
lushnikov 2016/11/18 21:44:46 let's wait for amount of resolved breakpoints in b
kozy 2016/11/19 00:46:09 Done.
631 {
632 return new Promise(resolve => InspectorTest.addSniffer(sourceFrame.__proto__ , "_breakpointDecorationsUpdatedForTest", resolve));
633 }
634
635 InspectorTest.dumpJavaScriptSourceFrameBreakpoints = function(sourceFrame)
636 {
637 var textEditor = sourceFrame._textEditor;
638 for (var lineNumber = 0; lineNumber < textEditor.linesCount; ++lineNumber) {
639 if (!textEditor.hasLineClass(lineNumber, "cm-breakpoint"))
640 continue;
641 var disabled = textEditor.hasLineClass(lineNumber, "cm-breakpoint-disabl ed");
642 var conditional = textEditor.hasLineClass(lineNumber, "cm-breakpoint-con ditional")
643 InspectorTest.addResult("breakpoint at " + lineNumber + (disabled ? " di sabled" : "") + (conditional ? " conditional" : ""));
644 }
645 }
646
619 }; 647 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698