-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test render name can be found via protocol
- Loading branch information
Showing
5 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
test/e2e/test-apps/other/custom-renderer-name-protocol/event.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"method": "envelope", | ||
"sentryKey": "37f8a2ee37c0409d8970bc7559c7c7e4", | ||
"appId": "277345", | ||
"data": { | ||
"sdk": { | ||
"name": "sentry.javascript.electron", | ||
"packages": [ | ||
{ | ||
"name": "npm:@sentry/electron", | ||
"version": "{{version}}" | ||
} | ||
], | ||
"version": "{{version}}" | ||
}, | ||
"contexts": { | ||
"app": { | ||
"app_name": "custom-renderer-name-protocol", | ||
"app_version": "1.0.0", | ||
"app_start_time": "{{time}}" | ||
}, | ||
"browser": { | ||
"name": "Chrome" | ||
}, | ||
"chrome": { | ||
"name": "Chrome", | ||
"type": "runtime", | ||
"version": "{{version}}" | ||
}, | ||
"device": { | ||
"arch": "{{arch}}", | ||
"family": "Desktop", | ||
"memory_size": 0, | ||
"free_memory": 0, | ||
"processor_count": 0, | ||
"processor_frequency": 0, | ||
"cpu_description": "{{cpu}}", | ||
"screen_resolution":"{{screen}}", | ||
"screen_density": 1, | ||
"language": "{{language}}" | ||
}, | ||
"node": { | ||
"name": "Node", | ||
"type": "runtime", | ||
"version": "{{version}}" | ||
}, | ||
"os": { | ||
"name": "{{platform}}", | ||
"version": "{{version}}" | ||
}, | ||
"runtime": { | ||
"name": "Electron", | ||
"version": "{{version}}" | ||
} | ||
}, | ||
"release": "custom-renderer-name-protocol@1.0.0", | ||
"environment": "development", | ||
"user": { | ||
"ip_address": "{{auto}}" | ||
}, | ||
"exception": { | ||
"values": [ | ||
{ | ||
"type": "Error", | ||
"value": "Some renderer error", | ||
"stacktrace": { | ||
"frames": [ | ||
{ | ||
"colno": 0, | ||
"filename": "app:///src/index.html", | ||
"function": "{{function}}", | ||
"in_app": true, | ||
"lineno": 0 | ||
} | ||
] | ||
}, | ||
"mechanism": { | ||
"handled": false, | ||
"type": "instrument" | ||
} | ||
} | ||
] | ||
}, | ||
"level": "error", | ||
"event_id": "{{id}}", | ||
"platform": "javascript", | ||
"timestamp": 0, | ||
"breadcrumbs": [ | ||
{ | ||
"timestamp": 0, | ||
"category": "electron", | ||
"message": "SomeWindow.dom-ready", | ||
"type": "ui" | ||
} | ||
], | ||
"request": { | ||
"url": "app:///src/index.html" | ||
}, | ||
"tags": { | ||
"event.environment": "javascript", | ||
"event.origin": "electron", | ||
"event.process": "SomeWindow", | ||
"event_type": "javascript" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/test-apps/other/custom-renderer-name-protocol/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "custom-renderer-name-protocol", | ||
"version": "1.0.0", | ||
"main": "src/main.js", | ||
"dependencies": { | ||
"@sentry/electron": "3.0.0" | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
test/e2e/test-apps/other/custom-renderer-name-protocol/recipe.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: Custom Renderer Name via Protocol | ||
command: yarn |
19 changes: 19 additions & 0 deletions
19
test/e2e/test-apps/other/custom-renderer-name-protocol/src/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<script> | ||
const { init } = require('@sentry/electron'); | ||
|
||
init({ | ||
debug: true, | ||
}); | ||
|
||
setTimeout(() => { | ||
throw new Error('Some renderer error'); | ||
}, 500); | ||
</script> | ||
</body> | ||
</html> |
27 changes: 27 additions & 0 deletions
27
test/e2e/test-apps/other/custom-renderer-name-protocol/src/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const path = require('path'); | ||
|
||
const { app, BrowserWindow } = require('electron'); | ||
const { init, IPCMode } = require('@sentry/electron'); | ||
|
||
init({ | ||
dsn: '__DSN__', | ||
debug: true, | ||
autoSessionTracking: false, | ||
ipcMode: IPCMode.Protocol, | ||
onFatalError: () => {}, | ||
getRendererName(_) { | ||
return 'SomeWindow'; | ||
}, | ||
}); | ||
|
||
app.on('ready', () => { | ||
const mainWindow = new BrowserWindow({ | ||
show: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
contextIsolation: false, | ||
}, | ||
}); | ||
|
||
mainWindow.loadFile(path.join(__dirname, 'index.html')); | ||
}); |