blob: d31d0b13e0de2d55ea10f2591d7a27226d5acc5a [file] [log] [blame]
<!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.EventBreakpoint.AnimationFrame");
suite.addTestCase({
name: "Worker.DOMDebugger.EventBreakpoint.AnimationFrame.setEventBreakpoint",
description: "Check setting an event breakpoint on all animation frames is not supported for a Worker target.",
async test() {
InspectorTest.assert(workerTarget.DOMDebuggerAgent, "Worker target should have a DOMDebuggerAgent.");
InspectorTest.assert(workerTarget.DOMDebuggerAgent.setEventBreakpoint, "The Worker's DOMDebuggerAgent should have a setEventBreakpoint command.");
await InspectorTest.expectException(async function() {
const breakpointType = "animation-frame";
await workerTarget.DOMDebuggerAgent.setEventBreakpoint(breakpointType);
});
},
});
suite.addTestCase({
name: "Worker.DOMDebugger.EventBreakpoint.AnimationFrame.removeEventBreakpoint",
description: "Check setting an event breakpoint on all animation frames is not supported for a Worker target.",
async test() {
InspectorTest.assert(workerTarget.DOMDebuggerAgent, "Worker target should have a DOMDebuggerAgent.");
InspectorTest.assert(workerTarget.DOMDebuggerAgent.removeEventBreakpoint, "The Worker's DOMDebuggerAgent should have a removeEventBreakpoint command.");
await InspectorTest.expectException(async function() {
const breakpointType = "animation-frame";
await workerTarget.DOMDebuggerAgent.removeEventBreakpoint(breakpointType);
});
},
});
InspectorTest.Worker.DOMDebugger.createWorkerTarget((target) => {
workerTarget = target;
suite.runTestCasesAndFinish();
});
}
</script>
</head>
<body onload="runTest()">
<p>Tests for animation frame event breakpoint functionality (DOMDebugger) in a Worker.</p>
</body>
</html>