Changeset 266538 in webkit
- Timestamp:
- Sep 3, 2020 1:07:39 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r266534 r266538 1 2020-09-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: allow url breakpoints to be configured 4 https://bugs.webkit.org/show_bug.cgi?id=215793 5 6 Reviewed by Brian Burg. 7 8 * inspector/debugger/resources/breakpoint-options-utilities.js: 9 (TestPage.registerInitializer.InspectorTest.BreakpointOptions.addTestCases): 10 11 * inspector/dom-debugger/resources/url-breakpoint-utilities.js: Added. 12 (TestPage.registerInitializer.InspectorTest.URLBreakpoint.teardown): 13 (TestPage.registerInitializer.InspectorTest.URLBreakpoint.createBreakpoint): 14 (TestPage.registerInitializer.InspectorTest.URLBreakpoint.addBreakpoint): 15 (TestPage.registerInitializer.InspectorTest.URLBreakpoint.request): 16 * inspector/dom-debugger/url-breakpoints.html: 17 * inspector/dom-debugger/url-breakpoints-expected.txt: 18 * inspector/dom-debugger/url-breakpoints-all-requests.html: Added. 19 * inspector/dom-debugger/url-breakpoints-all-requests-expected.txt: Added. 20 * inspector/dom-debugger/url-breakpoints-containing.html: Added. 21 * inspector/dom-debugger/url-breakpoints-containing-expected.txt: Added. 22 * inspector/dom-debugger/url-breakpoints-matching.html: Added. 23 * inspector/dom-debugger/url-breakpoints-matching-expected.txt: Added. 24 Split the one URL breakpoint test into four so they run quicker. 25 26 * inspector/dom-debugger/resources/event-breakpoint-utilities.js: 27 (TestPage.registerInitializer.InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases): Deleted. 28 * inspector/dom-debugger/event-animation-frame-breakpoints.html: 29 * inspector/dom-debugger/event-animation-frame-breakpoints-expected.txt: 30 * inspector/dom-debugger/event-interval-breakpoints.html: 31 * inspector/dom-debugger/event-interval-breakpoints-expected.txt: 32 * inspector/dom-debugger/event-listener-breakpoints.html: 33 * inspector/dom-debugger/event-listener-breakpoints-expected.txt: 34 * inspector/dom-debugger/event-timeout-breakpoints.html: 35 * inspector/dom-debugger/event-timeout-breakpoints-expected.txt: 36 Use `InspectorTest.BreakpointOptions.addTestCases` instead of duplicating the logic. 37 1 38 2020-09-03 Devin Rousso <drousso@apple.com> 2 39 -
trunk/LayoutTests/inspector/debugger/resources/breakpoint-options-utilities.js
r266534 r266538 2 2 InspectorTest.BreakpointOptions = {}; 3 3 4 InspectorTest.BreakpointOptions.addTestCases = function(suite, {createBreakpoint, triggerBreakpoint}) { 4 InspectorTest.BreakpointOptions.addTestCases = function(suite, {testCaseNamePrefix, createBreakpoint, triggerBreakpoint}) { 5 testCaseNamePrefix ??= ""; 6 5 7 function removeBreakpoint(breakpoint) { 6 8 if (breakpoint.removable) … … 13 15 14 16 suite.addTestCase({ 15 name: suite.name + ". Options.Condition",17 name: suite.name + "." + testCaseNamePrefix + "Options.Condition", 16 18 description: "Check that the debugger will not pause unless the breakpoint has a truthy breakpoint condition.", 17 19 async test() { … … 56 58 57 59 suite.addTestCase({ 58 name: suite.name + ". Options.IgnoreCount",60 name: suite.name + "." + testCaseNamePrefix + "Options.IgnoreCount", 59 61 description: "Check that the debugger will not pause unless the breakpoint is hit at least as many times as it's `ignoreCount`.", 60 62 async test() { … … 92 94 93 95 suite.addTestCase({ 94 name: suite.name + ". Options.Action.Log",96 name: suite.name + "." + testCaseNamePrefix + "Options.Action.Log", 95 97 description: "Check that log breakpoint actions execute when the breakpoint is hit.", 96 98 async test() { … … 151 153 152 154 suite.addTestCase({ 153 name: suite.name + ". Options.Actions.Evaluate",155 name: suite.name + "." + testCaseNamePrefix + "Options.Actions.Evaluate", 154 156 description: "Check that evaluate breakpoint actions execute when the breakpoint is hit.", 155 157 async test() { -
trunk/LayoutTests/inspector/dom-debugger/event-animation-frame-breakpoints-expected.txt
r266074 r266538 64 64 Triggering breakpoint... 65 65 PASS: Should pause. 66 -- Running test teardown.67 66 68 67 -- Running test case: DOMDebugger.Event.AnimationFrame.Options.IgnoreCount … … 83 82 Triggering breakpoint... 84 83 PASS: Should pause. 85 -- Running test teardown.86 84 87 85 -- Running test case: DOMDebugger.Event.AnimationFrame.Options.Action.Log … … 113 111 PASS: Should execute breakpoint action. 114 112 PASS: Should not pause. 115 -- Running test teardown.116 113 117 114 -- Running test case: DOMDebugger.Event.AnimationFrame.Options.Actions.Evaluate … … 143 140 PASS: Should execute breakpoint action. 144 141 PASS: Should not pause. 145 -- Running test teardown.146 142 -
trunk/LayoutTests/inspector/dom-debugger/event-animation-frame-breakpoints.html
r266074 r266538 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="../debugger/resources/breakpoint-options-utilities.js"></script> 5 6 <script src="../debugger/resources/log-active-stack-trace.js"></script> 6 7 <script src="resources/event-breakpoint-utilities.js"></script> … … 96 97 }); 97 98 98 InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases(suite, WI.EventBreakpoint.Type.AnimationFrame, eventName); 99 InspectorTest.BreakpointOptions.addTestCases(suite, { 100 createBreakpoint() { 101 return InspectorTest.EventBreakpoint.createBreakpoint(WI.EventBreakpoint.Type.AnimationFrame, {eventName}); 102 }, 103 triggerBreakpoint() { 104 return Promise.all([ 105 InspectorTest.awaitEvent("TestPage-" + eventName), 106 InspectorTest.evaluateInPage(`trigger_${eventName}()`), 107 ]); 108 }, 109 }); 99 110 100 111 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/dom-debugger/event-interval-breakpoints-expected.txt
r266074 r266538 84 84 Triggering breakpoint... 85 85 PASS: Should pause. 86 -- Running test teardown.87 86 88 87 -- Running test case: DOMDebugger.Event.Interval.Options.IgnoreCount … … 103 102 Triggering breakpoint... 104 103 PASS: Should pause. 105 -- Running test teardown.106 104 107 105 -- Running test case: DOMDebugger.Event.Interval.Options.Action.Log … … 133 131 PASS: Should execute breakpoint action. 134 132 PASS: Should not pause. 135 -- Running test teardown.136 133 137 134 -- Running test case: DOMDebugger.Event.Interval.Options.Actions.Evaluate … … 163 160 PASS: Should execute breakpoint action. 164 161 PASS: Should not pause. 165 -- Running test teardown.166 162 -
trunk/LayoutTests/inspector/dom-debugger/event-interval-breakpoints.html
r266074 r266538 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="../debugger/resources/breakpoint-options-utilities.js"></script> 5 6 <script src="../debugger/resources/log-active-stack-trace.js"></script> 6 7 <script src="resources/event-breakpoint-utilities.js"></script> … … 145 146 }); 146 147 147 InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases(suite, WI.EventBreakpoint.Type.Interval, eventName); 148 InspectorTest.BreakpointOptions.addTestCases(suite, { 149 createBreakpoint() { 150 return InspectorTest.EventBreakpoint.createBreakpoint(WI.EventBreakpoint.Type.Interval, {eventName}); 151 }, 152 triggerBreakpoint() { 153 return Promise.all([ 154 InspectorTest.awaitEvent("TestPage-" + eventName), 155 InspectorTest.evaluateInPage(`trigger_${eventName}()`), 156 ]); 157 }, 158 }); 148 159 149 160 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/dom-debugger/event-listener-breakpoints-expected.txt
r266074 r266538 146 146 Triggering breakpoint... 147 147 PASS: Should pause. 148 -- Running test teardown.149 148 150 149 -- Running test case: DOMDebugger.Event.Listener.Options.IgnoreCount … … 165 164 Triggering breakpoint... 166 165 PASS: Should pause. 167 -- Running test teardown.168 166 169 167 -- Running test case: DOMDebugger.Event.Listener.Options.Action.Log … … 195 193 PASS: Should execute breakpoint action. 196 194 PASS: Should not pause. 197 -- Running test teardown.198 195 199 196 -- Running test case: DOMDebugger.Event.Listener.Options.Actions.Evaluate … … 225 222 PASS: Should execute breakpoint action. 226 223 PASS: Should not pause. 227 -- Running test teardown. 228 224 -
trunk/LayoutTests/inspector/dom-debugger/event-listener-breakpoints.html
r266074 r266538 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="../debugger/resources/breakpoint-options-utilities.js"></script> 5 6 <script src="../debugger/resources/log-active-stack-trace.js"></script> 6 7 <script src="resources/event-breakpoint-utilities.js"></script> … … 222 223 }); 223 224 224 InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases(suite, WI.EventBreakpoint.Type.Listener, "click"); 225 InspectorTest.BreakpointOptions.addTestCases(suite, { 226 createBreakpoint() { 227 return InspectorTest.EventBreakpoint.createBreakpoint(WI.EventBreakpoint.Type.Listener, {eventName: "click"}); 228 }, 229 triggerBreakpoint() { 230 return Promise.all([ 231 InspectorTest.awaitEvent("TestPage-click"), 232 InspectorTest.evaluateInPage(`trigger_click()`), 233 ]); 234 }, 235 }); 225 236 226 237 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/dom-debugger/event-timeout-breakpoints-expected.txt
r266074 r266538 64 64 Triggering breakpoint... 65 65 PASS: Should pause. 66 -- Running test teardown.67 66 68 67 -- Running test case: DOMDebugger.Event.Timer.Options.IgnoreCount … … 83 82 Triggering breakpoint... 84 83 PASS: Should pause. 85 -- Running test teardown.86 84 87 85 -- Running test case: DOMDebugger.Event.Timer.Options.Action.Log … … 113 111 PASS: Should execute breakpoint action. 114 112 PASS: Should not pause. 115 -- Running test teardown.116 113 117 114 -- Running test case: DOMDebugger.Event.Timer.Options.Actions.Evaluate … … 143 140 PASS: Should execute breakpoint action. 144 141 PASS: Should not pause. 145 -- Running test teardown.146 142 -
trunk/LayoutTests/inspector/dom-debugger/event-timeout-breakpoints.html
r266074 r266538 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="../debugger/resources/breakpoint-options-utilities.js"></script> 5 6 <script src="../debugger/resources/log-active-stack-trace.js"></script> 6 7 <script src="resources/event-breakpoint-utilities.js"></script> … … 96 97 }); 97 98 98 InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases(suite, WI.EventBreakpoint.Type.Timeout, eventName); 99 InspectorTest.BreakpointOptions.addTestCases(suite, { 100 createBreakpoint() { 101 return InspectorTest.EventBreakpoint.createBreakpoint(WI.EventBreakpoint.Type.Timeout, {eventName}); 102 }, 103 triggerBreakpoint() { 104 return Promise.all([ 105 InspectorTest.awaitEvent("TestPage-" + eventName), 106 InspectorTest.evaluateInPage(`trigger_${eventName}()`), 107 ]); 108 }, 109 }); 99 110 100 111 suite.runTestCasesAndFinish(); -
trunk/LayoutTests/inspector/dom-debugger/resources/event-breakpoint-utilities.js
r266480 r266538 1 1 TestPage.registerInitializer(() => { 2 2 InspectorTest.EventBreakpoint = {}; 3 4 InspectorTest.EventBreakpoint.addBreakpointOptionsTestCases = function(suite, type, eventName) {5 async function triggerBreakpoint() {6 InspectorTest.log("Triggering breakpoint...");7 return Promise.all([8 InspectorTest.awaitEvent("TestPage-" + eventName),9 InspectorTest.evaluateInPage(`trigger_${eventName}()`),10 ]);11 }12 13 suite.addTestCase({14 name: suite.name + ".Options.Condition",15 description: "Check that the debugger will not pause unless the breakpoint has a truthy breakpoint condition.",16 async test() {17 let pauseCount = 0;18 19 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => {20 ++pauseCount;21 WI.debuggerManager.resume();22 });23 24 let breakpoint = await InspectorTest.EventBreakpoint.createBreakpoint(type, {eventName});25 26 InspectorTest.newline();27 28 InspectorTest.log("Setting condition to 'false'...");29 breakpoint.condition = "false";30 31 for (let i = 1; i <= 4; ++i) {32 if (i === 3) {33 InspectorTest.newline();34 35 InspectorTest.log("Setting condition to 'true'...");36 breakpoint.condition = "true";37 }38 39 InspectorTest.newline();40 41 await triggerBreakpoint();42 43 if (i <= 2)44 InspectorTest.expectEqual(pauseCount, 0, "Should not pause.");45 else46 InspectorTest.expectEqual(pauseCount, i - 2, "Should pause.");47 }48 49 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener);50 },51 teardown: InspectorTest.EventBreakpoint.teardown,52 });53 54 suite.addTestCase({55 name: suite.name + ".Options.IgnoreCount",56 description: "Check that the debugger will not pause unless the breakpoint is hit at least as many times as it's `ignoreCount`.",57 async test() {58 let pauseCount = 0;59 60 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => {61 ++pauseCount;62 WI.debuggerManager.resume();63 });64 65 let breakpoint = await InspectorTest.EventBreakpoint.createBreakpoint(type, {eventName});66 67 InspectorTest.newline();68 69 InspectorTest.log("Setting ignoreCount to '2'...");70 breakpoint.ignoreCount = 2;71 72 for (let i = 1; i <=4; ++i) {73 InspectorTest.newline();74 75 await triggerBreakpoint();76 77 if (i <= 2)78 InspectorTest.expectEqual(pauseCount, 0, "Should not pause.");79 else80 InspectorTest.expectEqual(pauseCount, i - 2, "Should pause.");81 }82 83 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener);84 },85 teardown: InspectorTest.EventBreakpoint.teardown,86 });87 88 suite.addTestCase({89 name: suite.name + ".Options.Action.Log",90 description: "Check that log breakpoint actions execute when the breakpoint is hit.",91 async test() {92 let pauseCount = 0;93 94 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => {95 ++pauseCount;96 WI.debuggerManager.resume();97 });98 99 let breakpoint = await InspectorTest.EventBreakpoint.createBreakpoint(type, {eventName});100 101 InspectorTest.newline();102 103 InspectorTest.log("Adding log action...");104 let action = new WI.BreakpointAction(WI.BreakpointAction.Type.Log, {data: "BREAKPOINT ACTION LOG 1"});105 breakpoint.addAction(action);106 107 for (let i = 1; i <= 4; ++i) {108 if (i > 1) {109 InspectorTest.newline();110 111 InspectorTest.log("Editing log action...");112 action.data = `BREAKPOINT ACTION LOG ${i}`;113 114 if (i === 3) {115 InspectorTest.log("Enabling auto-continue...");116 breakpoint.autoContinue = true;117 }118 }119 120 InspectorTest.newline();121 122 let [messageAddedEvent] = await Promise.all([123 WI.consoleManager.awaitEvent(WI.ConsoleManager.Event.MessageAdded),124 triggerBreakpoint(),125 ]);126 127 InspectorTest.expectEqual(messageAddedEvent.data.message.messageText, action.data, "Should execute breakpoint action.");128 129 if (i <= 2)130 InspectorTest.expectEqual(pauseCount, i, "Should pause.");131 else132 InspectorTest.expectEqual(pauseCount, 2, "Should not pause.");133 }134 135 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener);136 },137 teardown: InspectorTest.EventBreakpoint.teardown,138 });139 140 suite.addTestCase({141 name: suite.name + ".Options.Actions.Evaluate",142 description: "Check that evaluate breakpoint actions execute when the breakpoint is hit.",143 async test() {144 let pauseCount = 0;145 146 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => {147 ++pauseCount;148 WI.debuggerManager.resume();149 });150 151 let breakpoint = await InspectorTest.EventBreakpoint.createBreakpoint(type, {eventName});152 153 InspectorTest.newline();154 155 InspectorTest.log("Adding evaluate action...");156 let action = new WI.BreakpointAction(WI.BreakpointAction.Type.Evaluate, {data: "window.BREAKPOINT_ACTION_EVALUATE = 1;"});157 breakpoint.addAction(action);158 159 for (let i = 1; i <= 4; ++i) {160 if (i > 1) {161 InspectorTest.newline();162 163 InspectorTest.log("Editing evaluate action...");164 action.data = `window.BREAKPOINT_ACTION_EVALUATE = ${i};`;165 166 if (i === 3) {167 InspectorTest.log("Enabling auto-continue...");168 breakpoint.autoContinue = true;169 }170 }171 172 InspectorTest.newline();173 174 await triggerBreakpoint();175 176 let breakpointActionEvaluateResult = await InspectorTest.evaluateInPage(`window.BREAKPOINT_ACTION_EVALUATE`);177 InspectorTest.expectEqual(breakpointActionEvaluateResult, i, "Should execute breakpoint action.");178 179 if (i <= 2)180 InspectorTest.expectEqual(pauseCount, i, "Should pause.");181 else182 InspectorTest.expectEqual(pauseCount, 2, "Should not pause.");183 }184 185 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener);186 },187 teardown: InspectorTest.EventBreakpoint.teardown,188 });189 };190 3 191 4 InspectorTest.EventBreakpoint.teardown = function(resolve, reject) { -
trunk/LayoutTests/inspector/dom-debugger/url-breakpoints-expected.txt
r239703 r266538 3 3 4 4 == Running test suite: URLBreakpoint 5 -- Running test case: URLBreakpoint.BreakOnAll.Fetch6 Set pause on all requests.7 Request Fetch "resources/dataFetch.json"...8 PAUSED:9 PASS: Pause reason should be Fetch.10 PASS: Pause data URL should be empty.11 CALL STACK:12 0: [F] loadResourceFetch13 1: [P] Global Code14 -- Running test teardown.15 16 -- Running test case: URLBreakpoint.BreakOnContainingText.Fetch17 PASS: Added breakpoint for URL: data18 PASS: Breakpoint should not be disabled initially.19 Request Fetch "resources/dataFetch.json"...20 PAUSED:21 PASS: Pause reason should be Fetch.22 PASS: Pause data URL should match breakpoint URL.23 CALL STACK:24 0: [F] loadResourceFetch25 1: [P] Global Code26 -- Running test teardown.27 28 -- Running test case: URLBreakpoint.BreakOnMatchingRegularExpression.Fetch29 PASS: Added breakpoint for URL: data[A-Z]*.(json|txt|png)30 PASS: Breakpoint should not be disabled initially.31 Request Fetch "resources/dataFetch.json"...32 PAUSED:33 PASS: Pause reason should be Fetch.34 PASS: Pause data URL should match breakpoint URL.35 CALL STACK:36 0: [F] loadResourceFetch37 1: [P] Global Code38 -- Running test teardown.39 40 5 -- Running test case: URLBreakpoint.ShouldNotPauseOnDisabledBreakpoint.Fetch 41 PASS: Added breakpoint for URL: data 42 PASS: Breakpoint should not be disabled initially. 43 Breakpoint disabled. 6 Adding "text:data" URL Breakpoint... 7 Disabling breakpoint... 44 8 Request Fetch "resources/dataFetch.json"... 45 9 PASS: Should not pause for disabled breakpoint. … … 47 11 48 12 -- Running test case: URLBreakpoint.ShouldNotPauseOnNotContainingURL.Fetch 49 PASS: Added breakpoint for URL: nonexistant-url 50 PASS: Breakpoint should not be disabled initially. 13 Adding "text:nonexistant-url" URL Breakpoint... 51 14 Request Fetch "resources/dataFetch.json"... 52 15 PASS: Should not pause for breakpoint with different URL. … … 54 17 55 18 -- Running test case: URLBreakpoint.RemoveBreakpoint.Fetch 56 PASS: Added breakpoint for URL: data 57 PASS: Breakpoint should not be disabled initially. 58 Breakpoint removed. 19 Adding "text:data" URL Breakpoint... 20 Removing breakpoint... 59 21 Request Fetch "resources/dataFetch.json"... 60 22 PASS: Should not pause for removed breakpoint. … … 62 24 63 25 -- Running test case: URLBreakpoint.RemoveDisabledBreakpoint.Fetch 64 PASS: Added breakpoint for URL: data 65 PASS: Breakpoint should not be disabled initially. 66 Breakpoint disabled. 67 Breakpoint removed. 26 Adding "text:data" URL Breakpoint... 27 Disabling breakpoint... 28 Removing breakpoint... 68 29 Request Fetch "resources/dataFetch.json"... 69 30 PASS: Should not pause for removed disabled breakpoint. 70 31 -- Running test teardown. 71 32 72 -- Running test case: URLBreakpoint.BreakOnAll.XHR73 Set pause on all requests.74 Request XHR "resources/dataXHR.json"...75 PAUSED:76 PASS: Pause reason should be XHR.77 PASS: Pause data URL should be empty.78 CALL STACK:79 0: [F] loadResourceXHR80 1: [P] Global Code81 -- Running test teardown.82 83 -- Running test case: URLBreakpoint.BreakOnContainingText.XHR84 PASS: Added breakpoint for URL: data85 PASS: Breakpoint should not be disabled initially.86 Request XHR "resources/dataXHR.json"...87 PAUSED:88 PASS: Pause reason should be XHR.89 PASS: Pause data URL should match breakpoint URL.90 CALL STACK:91 0: [F] loadResourceXHR92 1: [P] Global Code93 -- Running test teardown.94 95 -- Running test case: URLBreakpoint.BreakOnMatchingRegularExpression.XHR96 PASS: Added breakpoint for URL: data[A-Z]*.(json|txt|png)97 PASS: Breakpoint should not be disabled initially.98 Request XHR "resources/dataXHR.json"...99 PAUSED:100 PASS: Pause reason should be XHR.101 PASS: Pause data URL should match breakpoint URL.102 CALL STACK:103 0: [F] loadResourceXHR104 1: [P] Global Code105 -- Running test teardown.106 107 33 -- Running test case: URLBreakpoint.ShouldNotPauseOnDisabledBreakpoint.XHR 108 PASS: Added breakpoint for URL: data 109 PASS: Breakpoint should not be disabled initially. 110 Breakpoint disabled. 34 Adding "text:data" URL Breakpoint... 35 Disabling breakpoint... 111 36 Request XHR "resources/dataXHR.json"... 112 37 PASS: Should not pause for disabled breakpoint. … … 114 39 115 40 -- Running test case: URLBreakpoint.ShouldNotPauseOnNotContainingURL.XHR 116 PASS: Added breakpoint for URL: nonexistant-url 117 PASS: Breakpoint should not be disabled initially. 41 Adding "text:nonexistant-url" URL Breakpoint... 118 42 Request XHR "resources/dataXHR.json"... 119 43 PASS: Should not pause for breakpoint with different URL. … … 121 45 122 46 -- Running test case: URLBreakpoint.RemoveBreakpoint.XHR 123 PASS: Added breakpoint for URL: data 124 PASS: Breakpoint should not be disabled initially. 125 Breakpoint removed. 47 Adding "text:data" URL Breakpoint... 48 Removing breakpoint... 126 49 Request XHR "resources/dataXHR.json"... 127 50 PASS: Should not pause for removed breakpoint. … … 129 52 130 53 -- Running test case: URLBreakpoint.RemoveDisabledBreakpoint.XHR 131 PASS: Added breakpoint for URL: data 132 PASS: Breakpoint should not be disabled initially. 133 Breakpoint disabled. 134 Breakpoint removed. 54 Adding "text:data" URL Breakpoint... 55 Disabling breakpoint... 56 Removing breakpoint... 135 57 Request XHR "resources/dataXHR.json"... 136 58 PASS: Should not pause for removed disabled breakpoint. -
trunk/LayoutTests/inspector/dom-debugger/url-breakpoints.html
r239703 r266538 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="../debugger/resources/breakpoint-options-utilities.js"></script> 5 6 <script src="../debugger/resources/log-active-stack-trace.js"></script> 6 7 <script src="../worker/resources/resource-utilities.js"></script> 8 <script src="resources/url-breakpoint-utilities.js"></script> 7 9 <script> 8 10 function test() … … 10 12 let suite = InspectorTest.createAsyncSuite("URLBreakpoint"); 11 13 12 function request(type) { 13 let url = `resources/data${type}.json`; 14 InspectorTest.log(`Request ${type} "${url}"...`); 15 return InspectorTest.evaluateInPage(`loadResource${type}("${url}")`); 16 } 17 18 function teardown(resolve) { 19 let breakpoints = WI.domDebuggerManager.urlBreakpoints; 20 for (let breakpoint of breakpoints) 21 WI.domDebuggerManager.removeURLBreakpoint(breakpoint); 22 23 WI.domDebuggerManager.allRequestsBreakpoint.disabled = true; 24 resolve(); 25 } 26 27 function addBreakpoint(type, url) { 28 return new Promise((resolve, reject) => { 29 let mainFrame = WI.networkManager.mainFrame; 30 InspectorTest.assert(mainFrame, "Missing main frame."); 31 if (!mainFrame) 32 reject(); 33 34 let breakpoint = new WI.URLBreakpoint(type, url); 35 WI.domDebuggerManager.awaitEvent(WI.DOMDebuggerManager.Event.URLBreakpointAdded) 36 .then(() => { 37 InspectorTest.pass("Added breakpoint for URL: " + url); 38 InspectorTest.expectFalse(breakpoint.disabled, "Breakpoint should not be disabled initially."); 39 resolve(breakpoint); 40 }); 41 42 WI.domDebuggerManager.addURLBreakpoint(breakpoint); 43 }); 44 } 45 46 for (let type of ["Fetch", "XHR"]) { 14 for (let api of ["Fetch", "XHR"]) { 47 15 suite.addTestCase({ 48 name: "URLBreakpoint.BreakOnAll." + type, 49 description: "Check that debugger pauses for all requests.", 50 teardown, 51 test(resolve, reject) { 52 InspectorTest.log("Set pause on all requests."); 53 WI.domDebuggerManager.allRequestsBreakpoint.disabled = false; 54 55 request(type); 56 57 WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused) 58 .then(() => { 59 let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target); 60 InspectorTest.log("PAUSED:"); 61 InspectorTest.expectEqual(targetData.pauseReason, WI.DebuggerManager.PauseReason[type], `Pause reason should be ${type}.`); 62 InspectorTest.expectFalse(targetData.pauseData.breakpointURL, "Pause data URL should be empty."); 63 64 logActiveStackTrace(); 65 66 return WI.debuggerManager.resume(); 67 }) 68 .then(resolve, reject); 69 } 70 }); 71 72 suite.addTestCase({ 73 name: "URLBreakpoint.BreakOnContainingText." + type, 74 description: "Check that debugger pauses on a URL containing text.", 75 teardown, 76 test(resolve, reject) { 77 let expectedBreakpointURL; 78 79 addBreakpoint(WI.URLBreakpoint.Type.Text, "data") 80 .then((breakpoint) => { 81 expectedBreakpointURL = breakpoint.url; 82 83 request(type); 84 return WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused); 85 }) 86 .then(() => { 87 let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target); 88 InspectorTest.log("PAUSED:"); 89 InspectorTest.expectEqual(targetData.pauseReason, WI.DebuggerManager.PauseReason[type], `Pause reason should be ${type}.`); 90 InspectorTest.expectEqual(targetData.pauseData.breakpointURL, expectedBreakpointURL, "Pause data URL should match breakpoint URL."); 91 92 logActiveStackTrace(); 93 94 return WI.debuggerManager.resume(); 95 }) 96 .then(resolve, reject); 97 } 98 }); 99 100 suite.addTestCase({ 101 name: "URLBreakpoint.BreakOnMatchingRegularExpression." + type, 102 description: "Check that debugger pauses based on a URL matching a regex pattern.", 103 teardown, 104 test(resolve, reject) { 105 let expectedBreakpointURL; 106 addBreakpoint(WI.URLBreakpoint.Type.RegularExpression, "data[A-Z]*\.(json|txt|png)") 107 .then((breakpoint) => { 108 expectedBreakpointURL = breakpoint.url; 109 110 request(type); 111 return WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused); 112 }) 113 .then(() => { 114 let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target); 115 InspectorTest.log("PAUSED:"); 116 InspectorTest.expectEqual(targetData.pauseReason, WI.DebuggerManager.PauseReason[type], `Pause reason should be ${type}.`); 117 InspectorTest.expectEqual(targetData.pauseData.breakpointURL, expectedBreakpointURL, "Pause data URL should match breakpoint URL."); 118 119 logActiveStackTrace(); 120 121 return WI.debuggerManager.resume(); 122 }) 123 .then(resolve, reject); 124 } 125 }); 126 127 suite.addTestCase({ 128 name: "URLBreakpoint.ShouldNotPauseOnDisabledBreakpoint." + type, 16 name: "URLBreakpoint.ShouldNotPauseOnDisabledBreakpoint." + api, 129 17 description: "Check that debugger does not pause for disabled breakpoint.", 130 teardown, 131 test(resolve, reject) { 18 async test() { 132 19 let paused = false; 133 20 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => { … … 136 23 }); 137 24 138 addBreakpoint(WI.URLBreakpoint.Type.Text, "data") 139 .then((breakpoint) => { 140 breakpoint.disabled = true; 141 InspectorTest.log("Breakpoint disabled."); 25 let breakpoint = await InspectorTest.URLBreakpoint.createBreakpoint(WI.URLBreakpoint.Type.Text, "data") 142 26 143 return request(type);144 })145 .then(() => { 146 InspectorTest.expectFalse(paused, "Should not pause for disabled breakpoint.");147 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 148 resolve();149 })150 .catch(reject);151 }27 InspectorTest.log("Disabling breakpoint..."); 28 breakpoint.disabled = true; 29 30 await InspectorTest.URLBreakpoint.request(api); 31 32 InspectorTest.expectFalse(paused, "Should not pause for disabled breakpoint."); 33 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 34 }, 35 teardown: InspectorTest.URLBreakpoint.teardown, 152 36 }); 153 37 154 38 suite.addTestCase({ 155 name: "URLBreakpoint.ShouldNotPauseOnNotContainingURL." + type,39 name: "URLBreakpoint.ShouldNotPauseOnNotContainingURL." + api, 156 40 description: "Check that debugger does not pause for breakpoint with different URL.", 157 teardown, 158 test(resolve, reject) { 41 async test() { 159 42 let paused = false; 160 43 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => { … … 163 46 }); 164 47 165 addBreakpoint(WI.URLBreakpoint.Type.Text, "nonexistant-url") 166 .then((breakpoint) => { 167 return request(type); 168 }) 169 .then(() => { 170 InspectorTest.expectFalse(paused, "Should not pause for breakpoint with different URL."); 171 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 172 resolve(); 173 }) 174 .catch(reject); 175 } 48 let breakpoint = await InspectorTest.URLBreakpoint.createBreakpoint(WI.URLBreakpoint.Type.Text, "nonexistant-url") 49 50 await InspectorTest.URLBreakpoint.request(api); 51 52 InspectorTest.expectFalse(paused, "Should not pause for breakpoint with different URL."); 53 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 54 }, 55 teardown: InspectorTest.URLBreakpoint.teardown, 176 56 }); 177 57 178 58 suite.addTestCase({ 179 name: "URLBreakpoint.RemoveBreakpoint." + type,59 name: "URLBreakpoint.RemoveBreakpoint." + api, 180 60 description: "Check that debugger does not pause for removed breakpoint.", 181 teardown, 182 test(resolve, reject) { 61 async test() { 183 62 let paused = false; 184 63 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => { … … 187 66 }); 188 67 189 addBreakpoint(WI.URLBreakpoint.Type.Text, "data") 190 .then((breakpoint) => { 191 WI.domDebuggerManager.removeURLBreakpoint(breakpoint); 192 InspectorTest.log("Breakpoint removed."); 68 let breakpoint = await InspectorTest.URLBreakpoint.createBreakpoint(WI.URLBreakpoint.Type.Text, "data") 193 69 194 return request(type);195 })196 .then(() => { 197 InspectorTest.expectFalse(paused, "Should not pause for removed breakpoint.");198 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 199 resolve();200 })201 .catch(reject);202 }70 InspectorTest.log("Removing breakpoint..."); 71 breakpoint.remove(); 72 73 await InspectorTest.URLBreakpoint.request(api); 74 75 InspectorTest.expectFalse(paused, "Should not pause for removed breakpoint."); 76 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 77 }, 78 teardown: InspectorTest.URLBreakpoint.teardown, 203 79 }); 204 80 205 81 suite.addTestCase({ 206 name: "URLBreakpoint.RemoveDisabledBreakpoint." + type,82 name: "URLBreakpoint.RemoveDisabledBreakpoint." + api, 207 83 description: "Check that a disabled breakpoint can be removed.", 208 teardown, 209 test(resolve, reject) { 84 async test() { 210 85 let paused = false; 211 86 let listener = WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, (event) => { … … 214 89 }); 215 90 216 addBreakpoint(WI.URLBreakpoint.Type.Text, "data") 217 .then((breakpoint) => { 218 breakpoint.disabled = true; 219 InspectorTest.log("Breakpoint disabled."); 91 let breakpoint = await InspectorTest.URLBreakpoint.createBreakpoint(WI.URLBreakpoint.Type.Text, "data") 220 92 221 WI.domDebuggerManager.removeURLBreakpoint(breakpoint);222 InspectorTest.log("Breakpoint removed.");93 InspectorTest.log("Disabling breakpoint..."); 94 breakpoint.disabled = true; 223 95 224 return request(type);225 })226 .then(() => { 227 InspectorTest.expectFalse(paused, "Should not pause for removed disabled breakpoint.");228 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 229 resolve();230 })231 .catch(reject);232 }96 InspectorTest.log("Removing breakpoint..."); 97 breakpoint.remove(); 98 99 await InspectorTest.URLBreakpoint.request(api); 100 101 InspectorTest.expectFalse(paused, "Should not pause for removed disabled breakpoint."); 102 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener); 103 }, 104 teardown: InspectorTest.URLBreakpoint.teardown, 233 105 }); 234 106 } -
trunk/Source/JavaScriptCore/ChangeLog
r266534 r266538 1 2020-09-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: allow url breakpoints to be configured 4 https://bugs.webkit.org/show_bug.cgi?id=215793 5 6 Reviewed by Brian Burg. 7 8 * inspector/protocol/DOMDebugger.json: 9 Add an `options` parameter to `DOMDebugger.setURLBreakpoint` to allow configuration. 10 Add an `isRegex` parameter to `DOMDebugger.removeURLBreakpoint` so that we know what 11 type of URL breakpoint is being removed. 12 1 13 2020-09-03 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json
r266074 r266538 57 57 "parameters": [ 58 58 { "name": "url", "type": "string", "description": "Resource URL substring or regular expression. All requests having this substring in the URL will get stopped upon. An empty string will pause on all requests." }, 59 { "name": "isRegex", "type": "boolean", "optional": true, "description": "Whether the URL string is a regular expression." } 59 { "name": "isRegex", "type": "boolean", "optional": true, "description": "Whether the URL string is a regular expression." }, 60 { "name": "options", "$ref": "Debugger.BreakpointOptions", "optional": true, "description": "Options to apply to this breakpoint to modify its behavior." } 60 61 ] 61 62 }, … … 64 65 "description": "Removes breakpoint from network activity for the given URL.", 65 66 "parameters": [ 66 { "name": "url", "type": "string", "description": "Resource URL substring. An empty string will stop pausing on all requests." } 67 { "name": "url", "type": "string", "description": "Resource URL substring. An empty string will stop pausing on all requests." }, 68 { "name": "isRegex", "type": "boolean", "optional": true, "description": "Whether the URL string is a regular expression." } 67 69 ] 68 70 } -
trunk/Source/WebCore/ChangeLog
r266533 r266538 1 2020-09-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: allow url breakpoints to be configured 4 https://bugs.webkit.org/show_bug.cgi?id=215793 5 6 Reviewed by Brian Burg. 7 8 Tests: inspector/dom-debugger/url-breakpoints.html 9 inspector/dom-debugger/url-breakpoints-all-requests.html 10 inspector/dom-debugger/url-breakpoints-containing.html 11 inspector/dom-debugger/url-breakpoints-matching.html 12 13 * inspector/agents/InspectorDOMDebuggerAgent.h: 14 * inspector/agents/InspectorDOMDebuggerAgent.cpp: 15 (WebCore::InspectorDOMDebuggerAgent::disable): 16 (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): 17 (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): 18 (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): 19 1 20 2020-09-03 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
r266074 r266538 81 81 m_pauseOnAllTimeoutsBreakpoint = nullptr; 82 82 83 m_urlBreakpoints.clear(); 84 m_pauseOnAllURLsEnabled = false; 83 m_urlTextBreakpoints.clear(); 84 m_urlRegexBreakpoints.clear(); 85 m_pauseOnAllURLsBreakpoint = nullptr; 85 86 } 86 87 … … 329 330 } 330 331 331 void InspectorDOMDebuggerAgent::setURLBreakpoint(ErrorString& errorString, const String& url, const bool* optionalIsRegex) 332 { 332 void InspectorDOMDebuggerAgent::setURLBreakpoint(ErrorString& errorString, const String& url, const bool* optionalIsRegex, const JSON::Object* optionsPayload) 333 { 334 auto breakpoint = InspectorDebuggerAgent::debuggerBreakpointFromPayload(errorString, optionsPayload); 335 if (!breakpoint) 336 return; 337 333 338 if (url.isEmpty()) { 334 if (m_pauseOnAllURLsEnabled) 339 if (!m_pauseOnAllURLsBreakpoint) 340 m_pauseOnAllURLsBreakpoint = WTFMove(breakpoint); 341 else 335 342 errorString = "Breakpoint for all URLs already exists"_s; 336 m_pauseOnAllURLsEnabled = true; 337 return; 338 } 339 340 bool isRegex = optionalIsRegex ? *optionalIsRegex : false; 341 auto result = m_urlBreakpoints.set(url, isRegex ? URLBreakpointType::RegularExpression : URLBreakpointType::Text); 342 if (!result.isNewEntry) 343 errorString = "Breakpoint for given url already exists"_s; 344 } 345 346 void InspectorDOMDebuggerAgent::removeURLBreakpoint(ErrorString& errorString, const String& url) 343 return; 344 } 345 346 if (optionalIsRegex && *optionalIsRegex) { 347 if (!m_urlRegexBreakpoints.add(url, breakpoint.releaseNonNull())) 348 errorString = "Breakpoint for given regex already exists"_s; 349 } else { 350 if (!m_urlTextBreakpoints.add(url, breakpoint.releaseNonNull())) 351 errorString = "Breakpoint for given URL already exists"_s; 352 } 353 } 354 355 void InspectorDOMDebuggerAgent::removeURLBreakpoint(ErrorString& errorString, const String& url, const bool* optionalIsRegex) 347 356 { 348 357 if (url.isEmpty()) { 349 if (!m_pauseOnAllURLs Enabled)358 if (!m_pauseOnAllURLsBreakpoint) 350 359 errorString = "Breakpoint for all URLs missing"_s; 351 m_pauseOnAllURLsEnabled = false; 352 return; 353 } 354 355 auto result = m_urlBreakpoints.remove(url); 356 if (!result) 357 errorString = "Breakpoint for given url missing"_s; 360 m_pauseOnAllURLsBreakpoint = nullptr; 361 return; 362 } 363 364 if (optionalIsRegex && *optionalIsRegex) { 365 if (!m_urlRegexBreakpoints.remove(url)) 366 errorString = "Missing breakpoint for given regex"_s; 367 } else { 368 if (!m_urlTextBreakpoints.remove(url)) 369 errorString = "Missing breakpoint for given URL"_s; 370 } 358 371 } 359 372 … … 363 376 return; 364 377 365 String breakpointURL; 366 if (m_pauseOnAllURLsEnabled) 367 breakpointURL = emptyString(); 368 else { 369 for (auto& [query, type] : m_urlBreakpoints) { 370 bool isRegex = type == URLBreakpointType::RegularExpression; 371 auto searchStringType = isRegex ? ContentSearchUtilities::SearchStringType::Regex : ContentSearchUtilities::SearchStringType::ContainsString; 372 auto regex = ContentSearchUtilities::createRegularExpressionForSearchString(query, false, searchStringType); 378 constexpr bool caseSensitive = false; 379 380 auto breakpointURL = emptyString(); 381 auto breakpoint = m_pauseOnAllURLsBreakpoint.copyRef(); 382 if (!breakpoint) { 383 for (auto& [query, textBreakpoint] : m_urlTextBreakpoints) { 384 auto regex = ContentSearchUtilities::createRegularExpressionForSearchString(query, caseSensitive, ContentSearchUtilities::SearchStringType::ContainsString); 373 385 if (regex.match(url) != -1) { 386 breakpoint = textBreakpoint.copyRef(); 374 387 breakpointURL = query; 375 388 break; … … 377 390 } 378 391 } 379 380 if (breakpointURL.isNull()) 381 return; 382 383 Inspector::DebuggerFrontendDispatcher::Reason breakReason; 384 if (source == URLBreakpointSource::Fetch) 392 if (!breakpoint) { 393 for (auto& [query, regexBreakpoint] : m_urlRegexBreakpoints) { 394 auto regex = ContentSearchUtilities::createRegularExpressionForSearchString(query, caseSensitive, ContentSearchUtilities::SearchStringType::Regex); 395 if (regex.match(url) != -1) { 396 breakpoint = regexBreakpoint.copyRef(); 397 breakpointURL = query; 398 break; 399 } 400 } 401 } 402 if (!breakpoint) 403 return; 404 405 auto breakReason = Inspector::DebuggerFrontendDispatcher::Reason::Other; 406 switch (source) { 407 case URLBreakpointSource::Fetch: 385 408 breakReason = Inspector::DebuggerFrontendDispatcher::Reason::Fetch; 386 else if (source == URLBreakpointSource::XHR) 409 break; 410 411 case URLBreakpointSource::XHR: 387 412 breakReason = Inspector::DebuggerFrontendDispatcher::Reason::XHR; 388 else { 389 ASSERT_NOT_REACHED(); 390 breakReason = Inspector::DebuggerFrontendDispatcher::Reason::Other; 413 break; 391 414 } 392 415 … … 394 417 eventData->setString("breakpointURL", breakpointURL); 395 418 eventData->setString("url", url); 396 m_debuggerAgent->breakProgram(breakReason, WTFMove(eventData) );419 m_debuggerAgent->breakProgram(breakReason, WTFMove(eventData), WTFMove(breakpoint)); 397 420 } 398 421 -
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h
r266074 r266538 66 66 67 67 // DOMDebuggerBackendDispatcherHandler 68 void setURLBreakpoint(ErrorString&, const String& url, const bool* optionalIsRegex) final;69 void removeURLBreakpoint(ErrorString&, const String& url ) final;68 void setURLBreakpoint(ErrorString&, const String& url, const bool* isRegex, const JSON::Object* options) final; 69 void removeURLBreakpoint(ErrorString&, const String& url, const bool* isRegex) final; 70 70 void setEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName, const JSON::Object* options) final; 71 71 void removeEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName) final; … … 105 105 RefPtr<JSC::Breakpoint> m_pauseOnAllTimeoutsBreakpoint; 106 106 107 enum class URLBreakpointType { RegularExpression, Text };108 HashMap<String, URLBreakpointType> m_urlBreakpoints;109 bool m_pauseOnAllURLsEnabled { false };107 HashMap<String, Ref<JSC::Breakpoint>> m_urlTextBreakpoints; 108 HashMap<String, Ref<JSC::Breakpoint>> m_urlRegexBreakpoints; 109 RefPtr<JSC::Breakpoint> m_pauseOnAllURLsBreakpoint; 110 110 }; 111 111 -
trunk/Source/WebInspectorUI/ChangeLog
r266537 r266538 1 2020-09-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: allow url breakpoints to be configured 4 https://bugs.webkit.org/show_bug.cgi?id=215793 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Models/URLBreakpoint.js: 9 (WI.URLBreakpoint.get editable): Added. 10 (WI.URLBreakpoint.fromJSON): 11 (WI.URLBreakpoint.prototype.get editable): 12 13 * UserInterface/Controllers/DOMDebuggerManager.js: 14 (WI.DOMDebuggerManager): 15 (WI.DOMDebuggerManager.prototype.initializeTarget): 16 (WI.DOMDebuggerManager.prototype.addURLBreakpoint): 17 (WI.DOMDebuggerManager.prototype.removeURLBreakpoint): 18 (WI.DOMDebuggerManager.prototype._setURLBreakpoint): Added. 19 (WI.DOMDebuggerManager.prototype._removeURLBreakpoint): Added. 20 (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged): 21 (WI.DOMDebuggerManager.prototype._handleURLBreakpointEditablePropertyChanged): Added. 22 (WI.DOMDebuggerManager.prototype._handleURLBreakpointActionsChanged): Added. 23 (WI.DOMDebuggerManager.prototype._updateURLBreakpoint): Deleted. 24 25 * UserInterface/Views/SourcesNavigationSidebarPanel.js: 26 (WI.SourcesNavigationSidebarPanel): 27 (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu): 28 (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialBreakpoint): Added. 29 (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Deleted. 30 31 * UserInterface/Views/URLBreakpointPopover.js: 32 (WI.URLBreakpointPopover.get editable): 33 34 * UserInterface/Base/Setting.js: 35 1 36 2020-09-03 Nikita Vasilyev <nvasilyev@apple.com> 2 37 -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r266534 r266538 206 206 selectedNetworkDetailContentViewIdentifier: new WI.Setting("network-detail-content-view-identifier", "preview"), 207 207 sourceMapsEnabled: new WI.Setting("source-maps-enabled", true), 208 showAllRequestsBreakpoint: new WI.Setting("show-all-requests-breakpoint", false),209 208 showCanvasPath: new WI.Setting("show-canvas-path", false), 210 209 showImageGrid: new WI.Setting("show-image-grid", true), -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
r266074 r266538 40 40 41 41 this._urlBreakpoints = []; 42 43 this._allRequestsBreakpointEnabledSetting = new WI.Setting("break-on-all-requests", false); 44 this._allRequestsBreakpoint = new WI.URLBreakpoint(WI.URLBreakpoint.Type.Text, "", { 45 disabled: !this._allRequestsBreakpointEnabledSetting.value, 46 }); 42 this._allRequestsBreakpoint = null; 47 43 48 44 WI.DOMBreakpoint.addEventListener(WI.Breakpoint.Event.DisabledStateDidChange, this._handleDOMBreakpointDisabledStateChanged, this); … … 55 51 56 52 WI.URLBreakpoint.addEventListener(WI.Breakpoint.Event.DisabledStateDidChange, this._handleURLBreakpointDisabledStateChanged, this); 53 WI.URLBreakpoint.addEventListener(WI.Breakpoint.Event.ConditionDidChange, this._handleURLBreakpointEditablePropertyChanged, this); 54 WI.URLBreakpoint.addEventListener(WI.Breakpoint.Event.IgnoreCountDidChange, this._handleURLBreakpointEditablePropertyChanged, this); 55 WI.URLBreakpoint.addEventListener(WI.Breakpoint.Event.AutoContinueDidChange, this._handleURLBreakpointEditablePropertyChanged, this); 56 WI.URLBreakpoint.addEventListener(WI.Breakpoint.Event.ActionsDidChange, this._handleURLBreakpointActionsChanged, this); 57 57 58 58 WI.domManager.addEventListener(WI.DOMManager.Event.NodeRemoved, this._nodeRemoved, this); … … 89 89 }; 90 90 91 function loadLegacySpecialBreakpoint(shownSettingsKey, enabledSettingsKey, callback) { 92 if (!WI.Setting.migrateValue(shownSettingsKey)) 93 return; 94 95 return callback({ 96 disabled: !WI.Setting.migrateValue(enabledSettingsKey), 97 }); 98 } 99 91 100 if (DOMDebuggerManager.supportsDOMBreakpoints()) { 92 101 loadBreakpoints(WI.DOMBreakpoint, WI.objectStores.domBreakpoints, ["dom-breakpoints"], (breakpoint) => { … … 100 109 }); 101 110 102 let loadLegacyGlobalEventBreakpoint = (type, shownSettingsKey, enabledSettingsKey) => { 103 if (!WI.Setting.migrateValue(shownSettingsKey)) 104 return; 105 106 return new WI.EventBreakpoint(type, { 107 disabled: !WI.Setting.migrateValue(enabledSettingsKey), 108 }); 109 }; 110 this._allAnimationFramesBreakpoint ??= loadLegacyGlobalEventBreakpoint(WI.EventBreakpoint.Type.AnimationFrame, "show-all-animation-frames-breakpoint", "break-on-all-animation-frames"); 111 this._allIntervalsBreakpoint ??= loadLegacyGlobalEventBreakpoint(WI.EventBreakpoint.Type.Interval, "show-all-inteverals-breakpoint", "break-on-all-intervals"); 112 this._allListenersBreakpoint ??= loadLegacyGlobalEventBreakpoint(WI.EventBreakpoint.Type.Listener, "show-all-listeners-breakpoint", "break-on-all-listeners"); 113 this._allTimeoutsBreakpoint ??= loadLegacyGlobalEventBreakpoint(WI.EventBreakpoint.Type.Timeout, "show-all-timeouts-breakpoint", "break-on-all-timeouts"); 111 this._allAnimationFramesBreakpoint ??= loadLegacySpecialBreakpoint("show-all-animation-frames-breakpoint", "break-on-all-animation-frames", (options) => new WI.EventBreakpoint(WI.EventBreakpoint.Type.AnimationFrame, options)); 112 this._allIntervalsBreakpoint ??= loadLegacySpecialBreakpoint("show-all-inteverals-breakpoint", "break-on-all-intervals", (options) => new WI.EventBreakpoint(WI.EventBreakpoint.Type.Interval, options)); 113 this._allListenersBreakpoint ??= loadLegacySpecialBreakpoint("show-all-listeners-breakpoint", "break-on-all-listeners", (options) => new WI.EventBreakpoint(WI.EventBreakpoint.Type.Listener, options)); 114 this._allTimeoutsBreakpoint ??= loadLegacySpecialBreakpoint("show-all-timeouts-breakpoint", "break-on-all-timeouts", (options) => new WI.EventBreakpoint(WI.EventBreakpoint.Type.Timeout, options)); 114 115 } 115 116 … … 118 119 this.addURLBreakpoint(breakpoint); 119 120 }); 121 122 this._allRequestsBreakpoint ??= loadLegacySpecialBreakpoint("show-all-requests-breakpoint", "break-on-all-requests", (options) => new WI.URLBreakpoint(WI.URLBreakpoint.Type.Text, "", options)); 120 123 } 121 124 } … … 143 146 this._setEventBreakpoint(this._allTimeoutsBreakpoint, target); 144 147 145 if ( !this._allRequestsBreakpoint.disabled)146 this._ updateURLBreakpoint(this._allRequestsBreakpoint, target);148 if (this._allRequestsBreakpoint) 149 this._setURLBreakpoint(this._allRequestsBreakpoint, target); 147 150 148 151 for (let breakpoint of this._listenerBreakpoints) { … … 153 156 for (let breakpoint of this._urlBreakpoints) { 154 157 if (!breakpoint.disabled) 155 this._ updateURLBreakpoint(breakpoint, target);158 this._setURLBreakpoint(breakpoint, target); 156 159 } 157 160 … … 446 449 addURLBreakpoint(breakpoint) 447 450 { 448 console.assert(breakpoint instanceof WI.URLBreakpoint );451 console.assert(breakpoint instanceof WI.URLBreakpoint, breakpoint); 449 452 if (!breakpoint) 450 453 return false; 451 454 452 if (breakpoint.special) { 453 this.dispatchEventToListeners(WI.DOMDebuggerManager.Event.URLBreakpointAdded, {breakpoint}); 454 return true; 455 } 456 457 console.assert(!this._urlBreakpoints.includes(breakpoint), "Already added URL breakpoint.", breakpoint); 458 if (this._urlBreakpoints.includes(breakpoint)) 459 return false; 460 461 if (this._urlBreakpoints.some((entry) => entry.type === breakpoint.type && entry.url === breakpoint.url)) 462 return false; 463 464 this._urlBreakpoints.push(breakpoint); 455 console.assert(!breakpoint.special, breakpoint); 456 if (breakpoint.url) { 457 if (this._urlBreakpoints.some((entry) => entry.type === breakpoint.type && entry.url === breakpoint.url)) 458 return false; 459 460 this._urlBreakpoints.push(breakpoint); 461 } else { 462 console.assert(!this._allRequestsBreakpoint, this._allRequestsBreakpoint, breakpoint); 463 this._allRequestsBreakpoint = breakpoint; 464 } 465 466 WI.debuggerManager.addProbesForBreakpoint(breakpoint); 465 467 466 468 this.dispatchEventToListeners(WI.DOMDebuggerManager.Event.URLBreakpointAdded, {breakpoint}); … … 468 470 if (!breakpoint.disabled) { 469 471 for (let target of WI.targets) 470 this._ updateURLBreakpoint(breakpoint, target);472 this._setURLBreakpoint(breakpoint, target); 471 473 } 472 474 … … 479 481 removeURLBreakpoint(breakpoint) 480 482 { 481 console.assert(breakpoint instanceof WI.URLBreakpoint );483 console.assert(breakpoint instanceof WI.URLBreakpoint, breakpoint); 482 484 if (!breakpoint) 483 485 return; 484 486 485 if (breakpoint.special) { 486 breakpoint.disabled = true; 487 this.dispatchEventToListeners(WI.DOMDebuggerManager.Event.URLBreakpointRemoved, {breakpoint}); 488 return; 489 } 490 491 if (!this._urlBreakpoints.includes(breakpoint)) 492 return; 493 494 this._urlBreakpoints.remove(breakpoint, true); 487 // Disable the breakpoint first, so removing actions doesn't re-add the breakpoint. 488 breakpoint.disabled = true; 489 breakpoint.clearActions(); 490 491 if (breakpoint.url) { 492 console.assert(this._urlBreakpoints.includes(breakpoint), breakpoint); 493 if (!this._urlBreakpoints.includes(breakpoint)) 494 return; 495 496 this._urlBreakpoints.remove(breakpoint); 497 } else { 498 console.assert(this._allRequestsBreakpoint, this._allRequestsBreakpoint); 499 this._allRequestsBreakpoint = null; 500 } 495 501 496 502 if (!this._restoringBreakpoints) 497 503 WI.objectStores.urlBreakpoints.deleteObject(breakpoint); 498 504 505 WI.debuggerManager.removeProbesForBreakpoint(breakpoint); 506 499 507 this.dispatchEventToListeners(WI.DOMDebuggerManager.Event.URLBreakpointRemoved, {breakpoint}); 500 501 if (breakpoint.disabled)502 return;503 504 for (let target of WI.targets) {505 // COMPATIBILITY (iOS 12.1): DOMDebugger.removeURLBreakpoint did not exist.506 if (target.hasCommand("DOMDebugger.removeURLBreakpoint"))507 target.DOMDebuggerAgent.removeURLBreakpoint(breakpoint.url);508 else if (target.hasCommand("DOMDebugger.removeXHRBreakpoint"))509 target.DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url);510 }511 508 } 512 509 … … 676 673 return; 677 674 678 // COMPATIBILITY (iOS 12): DOMDebugger.setEventBreakpoint did not exist. 675 // COMPATIBILITY (iOS 10.3): DOMDebugger.setEventListenerBreakpoint did not exist yet. 676 // COMPATIBILITY (iOS 12.0): DOMDebugger.setEventListenerBreakpoint was replaced by DOMDebugger.setEventBreakpoint. 679 677 if (target.hasCommand("DOMDebugger.setEventListenerBreakpoint")) { 680 678 console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener); … … 687 685 } 688 686 687 // COMPATIBILITY (iOS 12.0): DOMDebugger.setEventBreakpoint did not exist yet. 689 688 if (!target.hasCommand("DOMDebugger.setEventBreakpoint")) 690 689 return; … … 706 705 return; 707 706 708 // COMPATIBILITY (iOS 12): DOMDebugger.removeEventBreakpoint did not exist. 707 // COMPATIBILITY (iOS 10.3): DOMDebugger.removeEventListenerBreakpoint did not exist yet. 708 // COMPATIBILITY (iOS 12.0): DOMDebugger.removeEventListenerBreakpoint was replaced by DOMDebugger.removeEventBreakpoint. 709 709 if (target.hasCommand("DOMDebugger.removeEventListenerBreakpoint")) { 710 710 console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener); … … 713 713 } 714 714 715 // COMPATIBILITY (iOS 12.0): DOMDebugger.removeEventBreakpoint did not exist yet. 715 716 if (!target.hasCommand("DOMDebugger.removeEventBreakpoint")) 716 717 return; … … 721 722 } 722 723 723 _updateURLBreakpoint(breakpoint, target) 724 { 725 // COMPATIBILITY (iOS 12.1): DOMDebugger.removeURLBreakpoint did not exist. 726 if (target.hasCommand("DOMDebugger.setXHRBreakpoint") && target.hasCommand("DOMDebugger.removeXHRBreakpoint")) { 727 if (breakpoint.disabled) 728 target.DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url); 729 else { 730 if (!this._restoringBreakpoints && !WI.debuggerManager.breakpointsDisabledTemporarily) 731 WI.debuggerManager.breakpointsEnabled = true; 732 733 let isRegex = breakpoint.type === WI.URLBreakpoint.Type.RegularExpression; 734 target.DOMDebuggerAgent.setXHRBreakpoint(breakpoint.url, isRegex); 735 } 736 return; 737 } 738 739 if (!target.hasCommand("DOMDebugger.setURLBreakpoint") || !target.hasCommand("DOMDebugger.removeURLBreakpoint")) 740 return; 741 742 if (breakpoint.disabled) 743 target.DOMDebuggerAgent.removeURLBreakpoint(breakpoint.url); 744 else { 724 _setURLBreakpoint(breakpoint, target) 725 { 726 console.assert(!breakpoint.disabled, breakpoint); 727 728 // COMPATIBILITY (iOS 10.3): DOMDebugger.setXHRBreakpoint did not exist yet. 729 // COMPATIBILITY (iOS 12.2): DOMDebugger.setXHRBreakpoint was replaced by DOMDebugger.setURLBreakpoint. 730 if (target.hasCommand("DOMDebugger.setXHRBreakpoint")) { 745 731 if (!this._restoringBreakpoints && !WI.debuggerManager.breakpointsDisabledTemporarily) 746 732 WI.debuggerManager.breakpointsEnabled = true; 747 733 748 734 let isRegex = breakpoint.type === WI.URLBreakpoint.Type.RegularExpression; 749 target.DOMDebuggerAgent.setURLBreakpoint(breakpoint.url, isRegex); 750 } 735 target.DOMDebuggerAgent.setXHRBreakpoint(breakpoint.url, isRegex); 736 return; 737 } 738 739 // COMPATIBILITY (iOS 12.2): DOMDebugger.setURLBreakpoint did not exist yet. 740 if (!target.hasCommand("DOMDebugger.setURLBreakpoint")) 741 return; 742 743 if (!this._restoringBreakpoints && !WI.debuggerManager.breakpointsDisabledTemporarily) 744 WI.debuggerManager.breakpointsEnabled = true; 745 746 target.DOMDebuggerAgent.setURLBreakpoint.invoke({ 747 url: breakpoint.url, 748 isRegex: breakpoint.type === WI.URLBreakpoint.Type.RegularExpression, 749 options: breakpoint.optionsToProtocol(), 750 }); 751 } 752 753 _removeURLBreakpoint(breakpoint, target) 754 { 755 // COMPATIBILITY (iOS 10.3): DOMDebugger.removeXHRBreakpoint did not exist yet. 756 // COMPATIBILITY (iOS 12.2): DOMDebugger.removeXHRBreakpoint was replaced by DOMDebugger.setURLBreakpoint. 757 if (target.hasCommand("DOMDebugger.removeXHRBreakpoint")) { 758 target.DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url); 759 return; 760 } 761 762 // COMPATIBILITY (iOS 12.2): DOMDebugger.removeURLBreakpoint did not exist yet. 763 if (!target.hasCommand("DOMDebugger.removeURLBreakpoint")) 764 return; 765 766 target.DOMDebuggerAgent.removeURLBreakpoint.invoke({ 767 url: breakpoint.url, 768 isRegex: breakpoint.type === WI.URLBreakpoint.Type.RegularExpression, 769 }); 751 770 } 752 771 … … 795 814 return; 796 815 816 this._restoringBreakpoints = true; 797 817 for (let target of WI.targets) { 798 818 // Clear the old breakpoint from the backend before setting the new one. 799 this._removeEventBreakpoint(breakpoint, target) 819 this._removeEventBreakpoint(breakpoint, target); 800 820 this._setEventBreakpoint(breakpoint, target); 801 821 } 822 this._restoringBreakpoints = false; 802 823 } 803 824 … … 819 840 let breakpoint = event.target; 820 841 821 for (let target of WI.targets) 822 this._updateURLBreakpoint(breakpoint, target); 823 824 if (breakpoint === this._allRequestsBreakpoint) { 825 this._allRequestsBreakpointEnabledSetting.value = !breakpoint.disabled; 826 return; 842 for (let target of WI.targets) { 843 if (breakpoint.disabled) 844 this._removeURLBreakpoint(breakpoint, target); 845 else 846 this._setURLBreakpoint(breakpoint, target); 827 847 } 828 848 829 849 if (!this._restoringBreakpoints) 830 850 WI.objectStores.urlBreakpoints.putObject(breakpoint); 851 } 852 853 _handleURLBreakpointEditablePropertyChanged(event) 854 { 855 let breakpoint = event.target; 856 857 if (!this._restoringBreakpoints) 858 WI.objectStores.urlBreakpoints.putObject(breakpoint); 859 860 if (breakpoint.disabled) 861 return; 862 863 this._restoringBreakpoints = true; 864 for (let target of WI.targets) { 865 // Clear the old breakpoint from the backend before setting the new one. 866 this._removeURLBreakpoint(breakpoint, target) 867 this._setURLBreakpoint(breakpoint, target); 868 } 869 this._restoringBreakpoints = false; 870 } 871 872 _handleURLBreakpointActionsChanged(event) 873 { 874 let breakpoint = event.target; 875 876 this._handleURLBreakpointEditablePropertyChanged(event); 877 878 WI.debuggerManager.updateProbesForBreakpoint(breakpoint); 831 879 } 832 880 -
trunk/Source/WebInspectorUI/UserInterface/Models/URLBreakpoint.js
r266480 r266538 26 26 WI.URLBreakpoint = class URLBreakpoint extends WI.Breakpoint 27 27 { 28 constructor(type, url, {disabled } = {})28 constructor(type, url, {disabled, actions, condition, ignoreCount, autoContinue} = {}) 29 29 { 30 30 console.assert(Object.values(WI.URLBreakpoint.Type).includes(type), type); 31 31 console.assert(typeof url === "string", url); 32 32 33 super({disabled });33 super({disabled, actions, condition, ignoreCount, autoContinue}); 34 34 35 35 this._type = type; … … 39 39 // Static 40 40 41 static get editable() 42 { 43 // COMPATIBILITY (iOS 14): DOMDebugger.setURLBreakpoint did not have an "options" parameter yet. 44 return InspectorBackend.hasCommand("DOMDebugger.setURLBreakpoint", "options"); 45 } 46 41 47 static fromJSON(json) 42 48 { 43 49 return new WI.URLBreakpoint(json.type, json.url, { 44 50 disabled: json.disabled, 51 condition: json.condition, 52 actions: json.actions?.map((actionJSON) => WI.BreakpointAction.fromJSON(actionJSON)) || [], 53 ignoreCount: json.ignoreCount, 54 autoContinue: json.autoContinue, 45 55 }); 46 56 } … … 71 81 { 72 82 return this === WI.domDebuggerManager.allRequestsBreakpoint || super.special; 83 } 84 85 get editable() 86 { 87 return WI.URLBreakpoint.editable || super.editable; 73 88 } 74 89 -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
r266534 r266538 410 410 this._addBreakpoint(domBreakpoint); 411 411 412 if (WI. settings.showAllRequestsBreakpoint.value)413 WI.domDebuggerManager.addURLBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint);412 if (WI.domDebuggerManager.allRequestsBreakpoint) 413 this._addBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint); 414 414 415 415 for (let urlBreakpoints of WI.domDebuggerManager.urlBreakpoints) … … 1975 1975 _populateCreateBreakpointContextMenu(contextMenu) 1976 1976 { 1977 contextMenu.appendCheckboxItem(WI.repeatedUIString.assertionFailures(), () => { 1978 if (WI.debuggerManager.assertionFailuresBreakpoint) 1979 WI.debuggerManager.assertionFailuresBreakpoint.remove(); 1980 else 1981 WI.debuggerManager.createAssertionFailuresBreakpoint(); 1982 }, WI.debuggerManager.assertionFailuresBreakpoint); 1977 function addToggleForSpecialBreakpoint(label, breakpoint, callback) { 1978 contextMenu.appendCheckboxItem(label, () => { 1979 if (breakpoint) 1980 breakpoint.remove(); 1981 else 1982 callback(); 1983 }, !!breakpoint); 1984 } 1985 1986 addToggleForSpecialBreakpoint(WI.repeatedUIString.assertionFailures(), WI.debuggerManager.assertionFailuresBreakpoint, () => { 1987 WI.debuggerManager.createAssertionFailuresBreakpoint(); 1988 }); 1983 1989 1984 1990 contextMenu.appendSeparator(); 1985 1991 1986 1992 if (WI.JavaScriptBreakpoint.supportsMicrotasks()) { 1987 contextMenu.appendCheckboxItem(WI.repeatedUIString.allMicrotasks(), () => { 1988 if (WI.debuggerManager.allMicrotasksBreakpoint) 1989 WI.debuggerManager.allMicrotasksBreakpoint.remove(); 1990 else 1991 WI.debuggerManager.createAllMicrotasksBreakpoint(); 1992 }, WI.debuggerManager.allMicrotasksBreakpoint); 1993 addToggleForSpecialBreakpoint(WI.repeatedUIString.allMicrotasks(), WI.debuggerManager.allMicrotasksBreakpoint, () => { 1994 WI.debuggerManager.createAllMicrotasksBreakpoint(); 1995 }); 1993 1996 } 1994 1997 1995 1998 if (WI.DOMDebuggerManager.supportsEventBreakpoints() || WI.DOMDebuggerManager.supportsEventListenerBreakpoints()) { 1996 function addToggleForSpecialEventBreakpoint(label, breakpoint, type) { 1997 contextMenu.appendCheckboxItem(label, () => { 1998 if (breakpoint) 1999 WI.domDebuggerManager.removeEventBreakpoint(breakpoint); 2000 else 2001 WI.domDebuggerManager.addEventBreakpoint(new WI.EventBreakpoint(type)); 2002 }, !!breakpoint); 2003 } 2004 2005 addToggleForSpecialEventBreakpoint(WI.repeatedUIString.allAnimationFrames(), WI.domDebuggerManager.allAnimationFramesBreakpoint, WI.EventBreakpoint.Type.AnimationFrame); 2006 addToggleForSpecialEventBreakpoint(WI.repeatedUIString.allTimeouts(), WI.domDebuggerManager.allTimeoutsBreakpoint, WI.EventBreakpoint.Type.Timeout); 2007 addToggleForSpecialEventBreakpoint(WI.repeatedUIString.allIntervals(), WI.domDebuggerManager.allIntervalsBreakpoint, WI.EventBreakpoint.Type.Interval); 1999 addToggleForSpecialBreakpoint(WI.repeatedUIString.allAnimationFrames(), WI.domDebuggerManager.allAnimationFramesBreakpoint, () => { 2000 WI.domDebuggerManager.addEventBreakpoint(new WI.EventBreakpoint(WI.EventBreakpoint.Type.AnimationFrame)); 2001 }); 2002 addToggleForSpecialBreakpoint(WI.repeatedUIString.allTimeouts(), WI.domDebuggerManager.allTimeoutsBreakpoint, () => { 2003 WI.domDebuggerManager.addEventBreakpoint(new WI.EventBreakpoint(WI.EventBreakpoint.Type.Timeout)); 2004 }); 2005 addToggleForSpecialBreakpoint(WI.repeatedUIString.allIntervals(), WI.domDebuggerManager.allIntervalsBreakpoint, () => { 2006 WI.domDebuggerManager.addEventBreakpoint(new WI.EventBreakpoint(WI.EventBreakpoint.Type.Interval)); 2007 }); 2008 2008 2009 2009 contextMenu.appendSeparator(); 2010 2010 2011 2011 if (WI.DOMDebuggerManager.supportsAllListenersBreakpoint()) 2012 addToggleForSpecialEventBreakpoint(WI.repeatedUIString.allEvents(), WI.domDebuggerManager.allListenersBreakpoint, WI.EventBreakpoint.Type.Listener); 2012 addToggleForSpecialBreakpoint(WI.repeatedUIString.allEvents(), WI.domDebuggerManager.allListenersBreakpoint, () => { 2013 WI.domDebuggerManager.addEventBreakpoint(new WI.EventBreakpoint(WI.EventBreakpoint.Type.Listener)); 2014 }); 2013 2015 2014 2016 contextMenu.appendItem(WI.UIString("Event Breakpoint\u2026"), () => { … … 2021 2023 contextMenu.appendSeparator(); 2022 2024 2023 let allRequestsBreakpointShown = WI.settings.showAllRequestsBreakpoint.value; 2024 contextMenu.appendCheckboxItem(WI.repeatedUIString.allRequests(), () => { 2025 if (allRequestsBreakpointShown) 2026 WI.domDebuggerManager.removeURLBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint); 2027 else { 2028 WI.domDebuggerManager.allRequestsBreakpoint.disabled = false; 2029 WI.domDebuggerManager.addURLBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint); 2030 } 2031 }, allRequestsBreakpointShown); 2025 addToggleForSpecialBreakpoint(WI.repeatedUIString.allRequests(), WI.domDebuggerManager.allRequestsBreakpoint, () => { 2026 const url = ""; 2027 WI.domDebuggerManager.addURLBreakpoint(new WI.URLBreakpoint(WI.URLBreakpoint.Type.Text, url)); 2028 }); 2032 2029 2033 2030 contextMenu.appendItem(WI.DOMDebuggerManager.supportsURLBreakpoints() ? WI.UIString("URL Breakpoint\u2026") : WI.UIString("XHR Breakpoint\u2026"), () => { -
trunk/Source/WebInspectorUI/UserInterface/Views/URLBreakpointPopover.js
r266480 r266538 39 39 static get supportsEditing() 40 40 { 41 return false;41 return WI.URLBreakpoint.editable; 42 42 } 43 43
Note: See TracChangeset
for help on using the changeset viewer.