electron/spec/fixtures/api/render-view-deleted.html

33 строки
899 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
const {ipcRenderer, remote} = require('electron')
const contents = remote.getCurrentWebContents()
// This should not trigger a dereference and a remote getURL call should not fail
contents.emit('render-view-deleted', {}, 'not-a-process-id')
try {
contents.getURL()
} catch (error) {
ipcRenderer.send('error-message', 'Unexpected error on getURL call')
}
// This should trigger a dereference and a remote getURL call should fail
contents.emit('render-view-deleted', {}, contents.getProcessId())
try {
contents.getURL()
ipcRenderer.send('error-message', 'No error thrown')
} catch (error) {
ipcRenderer.send('error-message', error.message)
}
</script>
</head>
<body>
</body>
</html>