mirror of https://github.com/gorhill/uBlock.git
Run request data tests with Wasm enabled too (#3829)
This commit is contained in:
parent
36377320ae
commit
ffb4fe9b8f
|
@ -59,12 +59,14 @@ describe('Request data', () => {
|
||||||
texttrack: 'other',
|
texttrack: 'other',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let enableWASM = null;
|
||||||
let engine = null;
|
let engine = null;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
const { StaticNetFilteringEngine } = await import('../index.js');
|
const module = await import('../index.js');
|
||||||
|
enableWASM = module.enableWASM;
|
||||||
|
|
||||||
engine = await StaticNetFilteringEngine.create();
|
engine = await module.StaticNetFilteringEngine.create();
|
||||||
|
|
||||||
await engine.useLists([
|
await engine.useLists([
|
||||||
read('./data/assets/ublock/badware.txt')
|
read('./data/assets/ublock/badware.txt')
|
||||||
|
@ -92,6 +94,16 @@ describe('Request data', () => {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// False must go first:
|
||||||
|
// https://github.com/gorhill/uBlock/pull/3828#issuecomment-899470383
|
||||||
|
for ( let wasm of [ false, true ] ) {
|
||||||
|
context(`${wasm ? 'Wasm on' : 'Wasm off'}`, () => {
|
||||||
|
before(async () => {
|
||||||
|
if ( wasm ) {
|
||||||
|
assert(await enableWASM());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
for ( let i = 0; i < requests.length; i++ ) {
|
for ( let i = 0; i < requests.length; i++ ) {
|
||||||
const { url, frameUrl, cpt } = requests[i];
|
const { url, frameUrl, cpt } = requests[i];
|
||||||
const request = { url, originURL: frameUrl, type: typeMap[cpt] };
|
const request = { url, originURL: frameUrl, type: typeMap[cpt] };
|
||||||
|
@ -103,3 +115,5 @@ describe('Request data', () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue