Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,15 @@
<body></body>
<script>
window.onload = function() {
bc1 = new BroadcastChannel('no-cross-origin-messages');
bc2 = new BroadcastChannel('no-cross-origin-messages');
bc2.onmessage = e => {
parent.postMessage('done', "*");
};
// Post a message on bc1 and once we receive it in bc2, we know that the
// message should have been sent to bc0 if messages were being passed
// across origin (assuming compliance with the spec regarding message
// delivery in port creation order).
bc1.postMessage('ignition');
}
</script>

View File

@ -0,0 +1,78 @@
<body></body>
<script>
const BC0_FIRST_MSG = 'from BC0 - first';
const BC1_FIRST_MSG = 'from BC1 - first';
const BC2_FIRST_MSG = 'from BC2 - first';
const BC3_FIRST_MSG = 'from BC3 - first';
const BC0_SECOND_MSG = 'from BC0 - second';
const BC1_SECOND_MSG = 'from BC1 - second';
const BC2_SECOND_MSG = 'from BC2 - second';
const BC3_SECOND_MSG = 'done';
const BC0_TARGET_NAME = 'BC1';
const BC1_TARGET_NAME = 'BC1';
const BC2_TARGET_NAME = 'BC2';
const BC3_TARGET_NAME = 'BC3';
const MULTI_FRAME_ORDERING_TEST_CHANNEL_NAME = 'multi-frame-order';
var bc1, bc2, bc3;
var sentMessageCountForBc1 = 0;
var sentMessageCountForBc2 = 0;
var sentMessageCountForBc3 = 0;
var bc1_handler = e => {
window.top.logReceivedMessage(BC1_TARGET_NAME, e);
switch(sentMessageCountForBc1) {
case 0:
bc3 = new BroadcastChannel(MULTI_FRAME_ORDERING_TEST_CHANNEL_NAME);
bc3.onmessage = bc3_handler;
bc1.postMessage(BC1_FIRST_MSG);
break;
case 1:
bc1.postMessage(BC1_SECOND_MSG);
break;
case 2:
bc1.close();
return;
}
sentMessageCountForBc1 += 1;
}
var bc2_handler = e => {
window.top.logReceivedMessage(BC2_TARGET_NAME, e);
switch(sentMessageCountForBc2) {
case 0:
bc2.postMessage(BC2_FIRST_MSG);
bc2.postMessage(BC2_SECOND_MSG);
sentMessageCountForBc2 += 2;
break;
case 2:
bc2.close();
return;
}
};
var bc3_handler = e => {
window.top.logReceivedMessage(BC3_TARGET_NAME, e);
switch(sentMessageCountForBc3) {
case 0:
bc3.postMessage(BC3_FIRST_MSG);
break;
case 1:
bc3.postMessage(BC3_SECOND_MSG);
break;
case 2:
bc3.close();
return;
}
sentMessageCountForBc3 += 1;
};
window.onload = function() {
const params = new URLSearchParams(window.location.search);
if (params.get('id') === 'iframe1') {
bc1 = new BroadcastChannel(MULTI_FRAME_ORDERING_TEST_CHANNEL_NAME);
bc1.onmessage = bc1_handler;
} else if (params.get('id') === 'iframe2') {
bc2 = new BroadcastChannel(MULTI_FRAME_ORDERING_TEST_CHANNEL_NAME);
bc2.onmessage = bc2_handler;
}
}
</script>

View File

@ -0,0 +1,8 @@
<script>
const bc1 = new BroadcastChannel("ladila"),
bc2 = new BroadcastChannel("ladila");
bc2.onmessage = e => {
parent.postMessage(e.origin, "*");
}
bc1.postMessage("does not matter");
</script>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script>
try {
let c = new BroadcastChannel('foo');
parent.postMessage('Created', '*');
} catch (e) {
parent.postMessage('Exception: ' + e.name, '*');
}
</script>

View File

@ -0,0 +1,15 @@
let promise_func = null;
let promise = new Promise(resolve => promise_func = resolve);
const SERVICE_WORKER_TEST_CHANNEL_NAME = 'service worker';
const bc3 = new BroadcastChannel(SERVICE_WORKER_TEST_CHANNEL_NAME);
bc3.onmessage = e => {
bc3.postMessage('done');
promise_func();
};
bc3.postMessage('from worker');
// Ensure that the worker stays alive for the duration of the test
self.addEventListener('install', evt => {
evt.waitUntil(promise);
});

View File

@ -0,0 +1,37 @@
importScripts("/common/gc.js");
var c;
async function handler(e, reply) {
if (e.data.ping) {
c.postMessage(e.data.ping);
return;
}
if (e.data.blob) {
(() => {
c.postMessage({blob: new Blob(e.data.blob)});
})();
await garbageCollect();
}
c = new BroadcastChannel(e.data.channel);
let messages = [];
c.onmessage = e => {
if (e.data === 'ready') {
// Ignore any 'ready' messages from the other thread since there could
// be some race conditions between this BroadcastChannel instance
// being created / ready to receive messages and the message being sent.
return;
}
messages.push(e.data);
if (e.data == 'done')
reply(messages);
};
c.postMessage('from worker');
}
onmessage = e => handler(e, postMessage);
onconnect = e => {
let port = e.ports[0];
port.onmessage = e => handler(e, msg => port.postMessage(msg));
};