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

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

Issue 2545813003: [DevTools] fix minor issue with inline breakpoints (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-inline-breakpoint-decorations.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 682
683 InspectorTest.dumpJavaScriptSourceFrameBreakpoints = function(sourceFrame) 683 InspectorTest.dumpJavaScriptSourceFrameBreakpoints = function(sourceFrame)
684 { 684 {
685 var textEditor = sourceFrame._textEditor; 685 var textEditor = sourceFrame._textEditor;
686 for (var lineNumber = 0; lineNumber < textEditor.linesCount; ++lineNumber) { 686 for (var lineNumber = 0; lineNumber < textEditor.linesCount; ++lineNumber) {
687 if (!textEditor.hasLineClass(lineNumber, "cm-breakpoint")) 687 if (!textEditor.hasLineClass(lineNumber, "cm-breakpoint"))
688 continue; 688 continue;
689 var disabled = textEditor.hasLineClass(lineNumber, "cm-breakpoint-disabl ed"); 689 var disabled = textEditor.hasLineClass(lineNumber, "cm-breakpoint-disabl ed");
690 var conditional = textEditor.hasLineClass(lineNumber, "cm-breakpoint-con ditional") 690 var conditional = textEditor.hasLineClass(lineNumber, "cm-breakpoint-con ditional")
691 InspectorTest.addResult("breakpoint at " + lineNumber + (disabled ? " di sabled" : "") + (conditional ? " conditional" : "")); 691 InspectorTest.addResult("breakpoint at " + lineNumber + (disabled ? " di sabled" : "") + (conditional ? " conditional" : ""));
692 } 692
693 var bookmarks = textEditor.bookmarks(textEditor.fullRange(), Sources.JavaScr iptSourceFrame.BreakpointDecoration._bookmarkSymbol); 693 var range = new Common.TextRange(lineNumber, 0, lineNumber, textEditor.l ine(lineNumber).length);
694 bookmarks = bookmarks.filter(bookmark => !!bookmark.position()); 694 var bookmarks = textEditor.bookmarks(range, Sources.JavaScriptSourceFram e.BreakpointDecoration._bookmarkSymbol);
695 bookmarks.sort((bookmark1, bookmark2) => bookmark1.position().startColumn - bookmark2.position().startColumn); 695 bookmarks = bookmarks.filter(bookmark => !!bookmark.position());
696 for (var bookmark of bookmarks) { 696 bookmarks.sort((bookmark1, bookmark2) => bookmark1.position().startColum n - bookmark2.position().startColumn);
697 var position = bookmark.position(); 697 for (var bookmark of bookmarks) {
698 var element = bookmark[Sources.JavaScriptSourceFrame.BreakpointDecoratio n._elementSymbolForTest]; 698 var position = bookmark.position();
699 var disabled = element.classList.contains("cm-inline-disabled"); 699 var element = bookmark[Sources.JavaScriptSourceFrame.BreakpointDecor ation._elementSymbolForTest];
700 var conditional = element.classList.contains("cm-inline-conditional"); 700 var disabled = element.classList.contains("cm-inline-disabled");
701 InspectorTest.addResult(" inline breakpoint at (" + position.startLine + ", " + position.startColumn + ")" + (disabled ? " disabled" : "") + (condition al ? " conditional" : "")); 701 var conditional = element.classList.contains("cm-inline-conditional" );
702 InspectorTest.addResult(" inline breakpoint at (" + position.startL ine + ", " + position.startColumn + ")" + (disabled ? " disabled" : "") + (condi tional ? " conditional" : ""));
703 }
702 } 704 }
703 } 705 }
704 706
705 InspectorTest.clickJavaScriptSourceFrameBreakpoint = function(sourceFrame, lineN umber, index) 707 InspectorTest.clickJavaScriptSourceFrameBreakpoint = function(sourceFrame, lineN umber, index)
706 { 708 {
707 var textEditor = sourceFrame._textEditor; 709 var textEditor = sourceFrame._textEditor;
708 var lineLength = textEditor.line(lineNumber).length; 710 var lineLength = textEditor.line(lineNumber).length;
709 var lineRange = new Common.TextRange(lineNumber, 0, lineNumber, lineLength); 711 var lineRange = new Common.TextRange(lineNumber, 0, lineNumber, lineLength);
710 var bookmarks = textEditor.bookmarks(lineRange, Sources.JavaScriptSourceFram e.BreakpointDecoration._bookmarkSymbol); 712 var bookmarks = textEditor.bookmarks(lineRange, Sources.JavaScriptSourceFram e.BreakpointDecoration._bookmarkSymbol);
711 bookmarks.sort((bookmark1, bookmark2) => bookmark1.position().startColumn - bookmark2.position().startColumn); 713 bookmarks.sort((bookmark1, bookmark2) => bookmark1.position().startColumn - bookmark2.position().startColumn);
712 bookmarks[index][Sources.JavaScriptSourceFrame.BreakpointDecoration._element SymbolForTest].click(); 714 bookmarks[index][Sources.JavaScriptSourceFrame.BreakpointDecoration._element SymbolForTest].click();
713 } 715 }
714 716
715 }; 717 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-inline-breakpoint-decorations.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698