v1.0 with SW PWA enabled
This commit is contained in:
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/amd-function-name.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/amd-function-name.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("AMD Function Name", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads with a different AMD function name", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/amd-function-name/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/asset-in-worker.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/asset-in-worker.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Assets in workers", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("can be fetched", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "assetcontent") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/assets-in-worker/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/dynamic-import.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/dynamic-import.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Dynamic import", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/dynamic-import/build/runner.html";
|
||||
});
|
||||
});
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
return 4;
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/config.json
generated
vendored
Normal file
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/config.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"amdFunctionName": "foo"
|
||||
}
|
||||
22
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/entry.js
generated
vendored
Normal file
22
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/amd-function-name/entry.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import("./a.js").then(m => {
|
||||
if (m.default() != 4) {
|
||||
return;
|
||||
}
|
||||
if (!self.foo) {
|
||||
return;
|
||||
}
|
||||
window.parent.postMessage("a", "*");
|
||||
});
|
||||
1
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/build/assets/my-asset-620b911b.bin
generated
vendored
Normal file
1
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/build/assets/my-asset-620b911b.bin
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
assetcontent
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/entry.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/entry.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const w = new Worker("./worker.js");
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
25
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/rollup.config.js
generated
vendored
Normal file
25
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/rollup.config.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
const MARKER = "my-special-import";
|
||||
module.exports = (config, outputOptions, omt) => {
|
||||
config.plugins = [
|
||||
omt(),
|
||||
{
|
||||
resolveId(id) {
|
||||
if (id !== MARKER) {
|
||||
return;
|
||||
}
|
||||
return id;
|
||||
},
|
||||
load(id) {
|
||||
if (id !== MARKER) {
|
||||
return;
|
||||
}
|
||||
const referenceId = this.emitFile({
|
||||
type: "asset",
|
||||
name: "my-asset.bin",
|
||||
source: "assetcontent"
|
||||
});
|
||||
return `export default import.meta.ROLLUP_FILE_URL_${referenceId}`;
|
||||
}
|
||||
}
|
||||
];
|
||||
};
|
||||
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/worker.js
generated
vendored
Normal file
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/assets-in-worker/worker.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import url from "my-special-import";
|
||||
|
||||
fetch(url)
|
||||
.then(resp => resp.text())
|
||||
.then(text => postMessage(text));
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
window.parent.postMessage("a", "*");
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/entry.js
generated
vendored
Normal file
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/dynamic-import/entry.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import("./a.js").then(m => m.default());
|
||||
0
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/empty.js
generated
vendored
Normal file
0
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/empty.js
generated
vendored
Normal file
12
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/a.js
generated
vendored
Normal file
12
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/a.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
let worker;
|
||||
|
||||
if (self.document) {
|
||||
worker = new Worker(import.meta.url);
|
||||
}
|
||||
if (self.postMessage) {
|
||||
setTimeout(() => {
|
||||
postMessage("a");
|
||||
}, 500);
|
||||
}
|
||||
|
||||
export { worker };
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2020 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
22
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/entry.js
generated
vendored
Normal file
22
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta-worker/entry.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { worker } from "./a.js";
|
||||
if (worker) {
|
||||
worker.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
}
|
||||
// This should not get bundled into the worker module
|
||||
if (self.postMessage) {
|
||||
postMessage("xxx");
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
window.parent.postMessage(import.meta.url, "*");
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/entry.js
generated
vendored
Normal file
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-meta/entry.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import("./a.js").then(m => m.default());
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
self.postMessage("a");
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/b.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/b.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
return 1;
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2020 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/config.json
generated
vendored
Normal file
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/config.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"urlLoaderScheme": "fancy-custom-scheme"
|
||||
}
|
||||
21
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/entry.js
generated
vendored
Normal file
21
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/entry.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import workerURL from "fancy-custom-scheme:./worker.js";
|
||||
|
||||
// Set this, so it can be picked up in the test.
|
||||
self.workerURL = workerURL;
|
||||
|
||||
const w = new Worker(workerURL);
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/worker.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url-custom-scheme/worker.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
|
||||
a();
|
||||
import("./b.js");
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
self.postMessage("a");
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/b.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/b.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
return 1;
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2020 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
21
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/entry.js
generated
vendored
Normal file
21
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/entry.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import workerURL from "omt:./worker.js";
|
||||
|
||||
// Set this, so it can be picked up in the test.
|
||||
self.workerURL = workerURL;
|
||||
|
||||
const w = new Worker(workerURL);
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/worker.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/import-worker-url/worker.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
|
||||
a();
|
||||
import("./b.js");
|
||||
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/a.js
generated
vendored
Normal file
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/a.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default async function(f) {
|
||||
self.postMessage(f());
|
||||
}
|
||||
|
||||
export function someValue() {
|
||||
return self.String("a");
|
||||
}
|
||||
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/b.js
generated
vendored
Normal file
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/b.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Import for side-effects (of which there are none)
|
||||
// to make sure that a.js gets its own chunk.
|
||||
import {someValue} from "./a.js";
|
||||
|
||||
export default function() {
|
||||
return someValue();
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js" type="module"></script>
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/entry.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/entry.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const w = new Worker("./worker.js", { type: "module" });
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
4
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/rollup.config.js
generated
vendored
Normal file
4
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/rollup.config.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = (config, outputOptions, omt) => {
|
||||
outputOptions.format = "esm";
|
||||
config.plugins = [omt()];
|
||||
};
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/worker.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/module-worker/worker.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
import("./b.js").then(({default: f}) => {
|
||||
a(f);
|
||||
})
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
self.postMessage("a");
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/b.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/b.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
self.postMessage("b");
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
34
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/entry.js
generated
vendored
Normal file
34
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/entry.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
async function run() {
|
||||
await new Promise(resolve => {
|
||||
const w = new Worker("./worker_a.js");
|
||||
w.addEventListener("message", ev => {
|
||||
if (ev.data === "a") {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
await new Promise(resolve => {
|
||||
const w = new Worker("./worker_b.js");
|
||||
w.addEventListener("message", ev => {
|
||||
if (ev.data === "b") {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
window.parent.postMessage("a", "*");
|
||||
}
|
||||
|
||||
run();
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/worker_a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/worker_a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
|
||||
a();
|
||||
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/worker_b.js
generated
vendored
Normal file
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/more-workers/worker_b.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
async function run() {
|
||||
const { default: b } = await import("./b.js");
|
||||
b();
|
||||
}
|
||||
run();
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
window.parent.postMessage("a", "*");
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/config.json
generated
vendored
Normal file
3
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/config.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"publicPath": "/base/tests/fixtures/public-path/build"
|
||||
}
|
||||
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/entry.js
generated
vendored
Normal file
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/public-path/entry.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import("./a.js").then(m => m.default());
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/a.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/a.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
window.parent.postMessage("a", "*");
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/entry.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/simple-bundle/entry.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import A from "./a.js";
|
||||
|
||||
A();
|
||||
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/a.js
generated
vendored
Normal file
14
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/a.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default 4;
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/entry.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/single-default/entry.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import A from "./a.js";
|
||||
|
||||
window.parent.postMessage(A, "*");
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/a.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/a.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default async function() {
|
||||
const { default: f } = await import("./b.js");
|
||||
self.postMessage(f());
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/b.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/b.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
return "a";
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/entry.js
generated
vendored
Normal file
20
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/entry.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// The type module should get removed for AMD format!
|
||||
const w = new Worker(new URL("worker.js", import.meta.url), {
|
||||
type: "module"
|
||||
});
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/worker.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/url-import-meta-worker/worker.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
|
||||
a();
|
||||
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/a.js
generated
vendored
Normal file
17
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/a.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default async function() {
|
||||
const { default: f } = await import("./b.js");
|
||||
self.postMessage(f());
|
||||
}
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/b.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/b.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export default function() {
|
||||
return "a";
|
||||
}
|
||||
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/build/runner.html
generated
vendored
Normal file
15
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/build/runner.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!--
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<script src="entry.js"></script>
|
||||
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/entry.js
generated
vendored
Normal file
18
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/entry.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// The type module should get removed for AMD format!
|
||||
const w = new Worker("./worker.js", { type: "module" });
|
||||
w.addEventListener("message", ev => {
|
||||
window.parent.postMessage(ev.data, "*");
|
||||
});
|
||||
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/worker.js
generated
vendored
Normal file
16
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/fixtures/worker/worker.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import a from "./a.js";
|
||||
|
||||
a();
|
||||
37
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-meta-worker.test.js
generated
vendored
Normal file
37
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-meta-worker.test.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("omt: use import.meta.url in Worker constructor", function() {
|
||||
const runner = "/base/tests/fixtures/import-meta-worker/build/runner.html";
|
||||
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads itself as a module", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
} else {
|
||||
done(`Unexpected message! ${ev.data}`);
|
||||
}
|
||||
});
|
||||
this.ifr.src = runner;
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-meta.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-meta.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("import.meta", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (/^https?:\/\/.+\.js$/.test(ev.data)) {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/import-meta/build/runner.html";
|
||||
});
|
||||
});
|
||||
42
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-worker-url-custom-scheme.test.js
generated
vendored
Normal file
42
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-worker-url-custom-scheme.test.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("omt: URL import with custom scheme", function() {
|
||||
const runner =
|
||||
"/base/tests/fixtures/import-worker-url-custom-scheme/build/runner.html";
|
||||
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("imports as string", async function() {
|
||||
this.ifr.src = runner;
|
||||
await new Promise(resolve => this.ifr.addEventListener("load", resolve));
|
||||
assert.typeOf(this.ifr.contentWindow.workerURL, "string");
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = runner;
|
||||
});
|
||||
});
|
||||
41
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-worker-url.test.js
generated
vendored
Normal file
41
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/import-worker-url.test.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("omt: URL import", function() {
|
||||
const runner = "/base/tests/fixtures/import-worker-url/build/runner.html";
|
||||
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("imports as string", async function() {
|
||||
this.ifr.src = runner;
|
||||
await new Promise(resolve => this.ifr.addEventListener("load", resolve));
|
||||
assert.typeOf(this.ifr.contentWindow.workerURL, "string");
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = runner;
|
||||
});
|
||||
});
|
||||
47
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/module-worker.test.js
generated
vendored
Normal file
47
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/module-worker.test.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Module Worker", function() {
|
||||
const blob = new Blob([""], { type: "text/javascript" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
let supportsModuleWorker = false;
|
||||
const options = {
|
||||
get type() {
|
||||
supportsModuleWorker = true;
|
||||
}
|
||||
};
|
||||
new Worker(url, options).terminate();
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
beforeEach(function() {
|
||||
if (!supportsModuleWorker) {
|
||||
return this.skip();
|
||||
}
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("work", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/module-worker/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/more-workers.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/more-workers.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Worker", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("can load multiple workers", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/more-workers/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/public-path.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/public-path.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Public Path", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/public-path/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/simple-bundle.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/simple-bundle.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Simple bundle", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/simple-bundle/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/single-default.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/single-default.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Single default const export", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === 4) {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/single-default/build/runner.html";
|
||||
});
|
||||
});
|
||||
34
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/url-import-meta-worker.test.js
generated
vendored
Normal file
34
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/url-import-meta-worker.test.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Worker", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads module-relative worker paths", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src =
|
||||
"/base/tests/fixtures/url-import-meta-worker/build/runner.html";
|
||||
});
|
||||
});
|
||||
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/worker.test.js
generated
vendored
Normal file
33
frontend/node_modules/@surma/rollup-plugin-off-main-thread/tests/worker.test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
describe("Worker", function() {
|
||||
beforeEach(function() {
|
||||
this.ifr = document.createElement("iframe");
|
||||
document.body.append(this.ifr);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
this.ifr.remove();
|
||||
});
|
||||
|
||||
it("loads transpiled modules", function(done) {
|
||||
window.addEventListener("message", function l(ev) {
|
||||
if (ev.data === "a") {
|
||||
window.removeEventListener("message", l);
|
||||
done();
|
||||
}
|
||||
});
|
||||
this.ifr.src = "/base/tests/fixtures/worker/build/runner.html";
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user