| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| <script src="resources/dom-debugger-utilities.js"></script> |
| <script> |
| function test() |
| { |
| let workerTarget = null; |
| |
| let suite = InspectorTest.createAsyncSuite("Worker.DOMDebugger.DOMBreakpoint"); |
| |
| suite.addTestCase({ |
| name: "Worker.DOMDebugger.DOMBreakpoint.setDOMBreakpoint", |
| description: "Check that DOMDebugger.setDOMBreakpoint is not supported for a Worker target.", |
| async test() { |
| InspectorTest.assert(workerTarget.DOMDebuggerAgent, "Worker target should have a DOMDebuggerAgent."); |
| InspectorTest.assert(workerTarget.DOMDebuggerAgent.setDOMBreakpoint, "The Worker's DOMDebuggerAgent should have a setDOMBreakpoint command."); |
| |
| await InspectorTest.expectException(async function() { |
| const nodeId = 0; |
| const type = "INVALID"; |
| await workerTarget.DOMDebuggerAgent.setDOMBreakpoint(nodeId, type); |
| }); |
| }, |
| }); |
| |
| suite.addTestCase({ |
| name: "Worker.DOMDebugger.DOMBreakpoint.removeDOMBreakpoint", |
| description: "Check that DOMDebugger.removeDOMBreakpoint is not supported for a Worker target.", |
| async test() { |
| InspectorTest.assert(workerTarget.DOMDebuggerAgent, "Worker target should have a DOMDebuggerAgent."); |
| InspectorTest.assert(workerTarget.DOMDebuggerAgent.removeDOMBreakpoint, "The Worker's DOMDebuggerAgent should have a removeDOMBreakpoint command."); |
| |
| await InspectorTest.expectException(async function() { |
| const nodeId = 0; |
| const type = "INVALID"; |
| await workerTarget.DOMDebuggerAgent.removeDOMBreakpoint(nodeId, type); |
| }); |
| }, |
| }); |
| |
| InspectorTest.Worker.DOMDebugger.createWorkerTarget((target) => { |
| workerTarget = target; |
| suite.runTestCasesAndFinish(); |
| }); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests for DOM breakpoint functionality (DOMDebugger) in a Worker.</p> |
| </body> |
| </html> |