chore: move remote module fixtures for easier deletion when removed (#25736)
This commit is contained in:
parent
485adae94c
commit
508b8d902b
28 changed files with 38 additions and 40 deletions
|
@ -1,7 +0,0 @@
|
|||
exports.call = function (func) {
|
||||
return func();
|
||||
};
|
||||
|
||||
exports.constructor = function () {
|
||||
this.test = 'test';
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
exports.returnArgs = function (...args) {
|
||||
return args;
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
let value = 'old';
|
||||
|
||||
class BaseClass {
|
||||
method () {
|
||||
return 'method';
|
||||
}
|
||||
|
||||
get readonly () {
|
||||
return 'readonly';
|
||||
}
|
||||
|
||||
get value () {
|
||||
return value;
|
||||
}
|
||||
|
||||
set value (val) {
|
||||
value = val;
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedClass extends BaseClass {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
base: new BaseClass(),
|
||||
derived: new DerivedClass()
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
const path = require('path');
|
||||
const { remote } = require('electron');
|
||||
const { Buffer } = window;
|
||||
|
||||
delete window.Buffer;
|
||||
delete global.Buffer;
|
||||
|
||||
// Test that remote.js doesn't use Buffer global
|
||||
if (remote) {
|
||||
remote.require(path.join(__dirname, 'print_name.js')).echo(Buffer.from('bar'));
|
||||
}
|
||||
|
||||
window.test = Buffer.from('buffer');
|
|
@ -1,11 +0,0 @@
|
|||
class Foo {
|
||||
set bar (value) {
|
||||
throw new Error('setting error');
|
||||
}
|
||||
|
||||
get bar () {
|
||||
throw new Error('getting error');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Foo();
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = function (error) {
|
||||
throw error;
|
||||
};
|
|
@ -1,4 +0,0 @@
|
|||
function foo () {}
|
||||
foo.bar = 'baz';
|
||||
|
||||
module.exports = foo;
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = function (cb) {
|
||||
return cb.length;
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
exports.setup = function () {
|
||||
const foo = {};
|
||||
|
||||
foo.bar = function () {
|
||||
return delete foo.bar.baz && delete foo.bar;
|
||||
};
|
||||
|
||||
foo.bar.baz = function () {
|
||||
return 3;
|
||||
};
|
||||
|
||||
return foo;
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
function foo () {
|
||||
return 'hello';
|
||||
}
|
||||
foo.bar = 'baz';
|
||||
foo.nested = {
|
||||
prop: 'yes'
|
||||
};
|
||||
foo.method1 = function () {
|
||||
return 'world';
|
||||
};
|
||||
foo.method1.prop1 = function () {
|
||||
return 123;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
foo: foo
|
||||
};
|
|
@ -1 +0,0 @@
|
|||
exports.aFunction = function () { return 1127; };
|
|
@ -1 +0,0 @@
|
|||
exports.id = 1127;
|
|
@ -1,11 +0,0 @@
|
|||
const foo = Object.create(null);
|
||||
foo.bar = 'baz';
|
||||
foo.baz = false;
|
||||
module.exports = {
|
||||
foo: foo,
|
||||
bar: 1234,
|
||||
anonymous: new (class {})(),
|
||||
getConstructorName: function (value) {
|
||||
return value.constructor.name;
|
||||
}
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
const { remote, ipcRenderer } = require('electron');
|
||||
remote.getCurrentWindow().rendererFunc = () => {
|
||||
ipcRenderer.send('done');
|
||||
};
|
||||
remote.getCurrentWindow().rendererFunc();
|
|
@ -1,5 +0,0 @@
|
|||
const { ipcRenderer, remote } = require('electron');
|
||||
|
||||
window.onload = function () {
|
||||
ipcRenderer.send('remote', typeof remote);
|
||||
};
|
|
@ -1,36 +0,0 @@
|
|||
exports.print = function (obj) {
|
||||
return obj.constructor.name;
|
||||
};
|
||||
|
||||
exports.echo = function (obj) {
|
||||
return obj;
|
||||
};
|
||||
|
||||
const typedArrays = {
|
||||
Int8Array,
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Int16Array,
|
||||
Uint16Array,
|
||||
Int32Array,
|
||||
Uint32Array,
|
||||
Float32Array,
|
||||
Float64Array
|
||||
};
|
||||
|
||||
exports.typedArray = function (type, values) {
|
||||
const constructor = typedArrays[type];
|
||||
const array = new constructor(values.length);
|
||||
for (let i = 0; i < values.length; ++i) {
|
||||
array[i] = values[i];
|
||||
}
|
||||
return array;
|
||||
};
|
||||
|
||||
exports.getNaN = function () {
|
||||
return NaN;
|
||||
};
|
||||
|
||||
exports.getInfinity = function () {
|
||||
return Infinity;
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
exports.twicePromise = function (promise) {
|
||||
return promise.then(function (value) {
|
||||
return value * 2;
|
||||
});
|
||||
};
|
|
@ -1,11 +0,0 @@
|
|||
exports.property = 1127;
|
||||
|
||||
function func () {
|
||||
|
||||
}
|
||||
func.property = 'foo';
|
||||
exports.func = func;
|
||||
|
||||
exports.getFunctionProperty = () => {
|
||||
return `${func.property}-${process.type}`;
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
exports.reject = function (promise) {
|
||||
return promise.then(function () {
|
||||
throw Error('rejected');
|
||||
});
|
||||
};
|
|
@ -1,11 +0,0 @@
|
|||
const { BrowserWindow } = require('electron');
|
||||
|
||||
class Foo {
|
||||
set bar (value) { // eslint-disable-line accessor-pairs
|
||||
if (!(value instanceof BrowserWindow)) {
|
||||
throw new Error('setting error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Foo();
|
|
@ -1,15 +0,0 @@
|
|||
class Foo {
|
||||
static foo () {
|
||||
return 3;
|
||||
}
|
||||
|
||||
baz () {
|
||||
return 123;
|
||||
}
|
||||
}
|
||||
|
||||
Foo.bar = 'baz';
|
||||
|
||||
module.exports = {
|
||||
Foo: Foo
|
||||
};
|
|
@ -1,4 +0,0 @@
|
|||
function hello () {
|
||||
}
|
||||
hello.toString = 'hello';
|
||||
module.exports = { functionWithToStringProperty: hello };
|
|
@ -1,3 +0,0 @@
|
|||
exports.reject = function () {
|
||||
return Promise.reject(new Error('rejected'));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue