tests.js 555 B

1234567891011121314151617181920212223
  1. /**
  2. @module preloader tests
  3. */
  4. if (location.origin !== 'file://') {
  5. throw new Error('Wrong test file loaded');
  6. } else {
  7. // load dapp preloader file
  8. require('./dapps.js');
  9. const electron = require('electron');
  10. const ipcRenderer = electron.ipcRenderer;
  11. window.ipcProvider = require('../ipc/ipcProviderWrapper.js');
  12. window.permissions = {};
  13. ipcRenderer.sendToHost('sendTestData');
  14. ipcRenderer.on('uiAction_sendTestData', function(e, permissions, coinbase) {
  15. window.permissions = permissions;
  16. window.coinbase = coinbase;
  17. });
  18. }