Skip to content

Commit

Permalink
Add TestReporter & LifecycleReporter to Inspector API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Nov 15, 2024
1 parent 3bc4abf commit fdea7b0
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/JavaScriptCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,10 @@ set(JavaScriptCore_INSPECTOR_DOMAINS
${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json

# Bun
${JAVASCRIPTCORE_DIR}/inspector/protocol/LifecycleReporter.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/TestReporter.json
)

add_custom_command(
Expand Down
27 changes: 27 additions & 0 deletions Source/JavaScriptCore/inspector/protocol/LifecycleReporter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"domain": "LifecycleReporter",
"description": "LifecycleReporter domain allows reporting of lifecycle events.",
"debuggableTypes": ["itml", "javascript"],
"targetTypes": ["itml", "javascript"],
"types": [],
"commands": [
{
"name": "enable",
"description": "Enables LifecycleReporter domain events."
},
{
"name": "disable",
"description": "Disables LifecycleReporter domain events."
}
],
"events": [
{
"name": "reload",
"parameters": []
},
{
"name": "error",
"parameters": [{ "name": "message", "$ref": "Console.ConsoleMessage", "description": "Source of the error" }]
}
]
}
58 changes: 58 additions & 0 deletions Source/JavaScriptCore/inspector/protocol/TestReporter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"domain": "TestReporter",
"description": "TestReporter domain allows reporting of lifecycle events.",
"debuggableTypes": ["itml", "javascript"],
"targetTypes": ["itml", "javascript"],
"types": [
{
"id": "TestStatus",
"type": "string",
"enum": ["pass", "fail", "timeout", "skip", "todo"]
}
],
"commands": [
{
"name": "enable",
"description": "Enables TestReporter domain events."
},
{
"name": "disable",
"description": "Disables TestReporter domain events."
}
],
"events": [
{
"name": "found",
"parameters": [
{ "name": "id", "type": "integer", "description": "Unique identifier of the test that was found." },
{
"name": "scriptId",
"$ref": "Debugger.ScriptId",
"description": "Unique identifier of the script that started the test."
},
{
"name": "line",
"type": "integer",
"description": "Line number in the script that started the test."
},
{ "name": "name", "type": "string", "description": "Name of the test that started.", "optional": true }
]
},
{
"name": "start",
"parameters": [{ "name": "id", "type": "integer", "description": "Unique identifier of the test that started." }]
},
{
"name": "end",
"parameters": [
{ "name": "id", "type": "integer", "description": "Unique identifier of the test that ended." },
{ "name": "status", "$ref": "TestStatus", "description": "Status of the test that ended." },
{
"name": "elapsed",
"type": "number",
"description": "Elapsed time in milliseconds since the test started."
}
]
}
]
}

0 comments on commit fdea7b0

Please sign in to comment.