X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
spec: fix test that bridged ipcrenderer
  • Loading branch information
MarshallOfSound committed Oct 31, 2023
commit 8a71f9cf57b7412304ccd37fd1638d3a87d7fed8
3 changes: 2 additions & 1 deletion spec/fixtures/apps/libuv-hang/preload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('api', {
ipcRenderer,
// This is not safe, do not copy this code into your app
invoke: (...args) => ipcRenderer.invoke(...args),
run: async () => {
const { promises: fs } = require('node:fs');
for (let i = 0; i < 10; i++) {
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/apps/libuv-hang/renderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { run, ipcRenderer } = window.api;
const { run, invoke } = window.api;

run().then(async () => {
const count = await ipcRenderer.invoke('reload-successful');
const count = await invoke('reload-successful');
if (count < 3) location.reload();
}).catch(console.log);
X Tutup