mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
32 lines
852 B
HTML
32 lines
852 B
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Test app for bug 1172562</title>
|
||
|
<script src='test.js'></script>
|
||
|
<script type='application/javascript;version=1.7'>
|
||
|
|
||
|
function runTests() {
|
||
|
return Promise.resolve()
|
||
|
.then(() => { return navigator.serviceWorker.ready })
|
||
|
.then((registration) => {
|
||
|
return new Promise((resolve) => {
|
||
|
var worker = registration.waiting || registration.active;
|
||
|
worker.postMessage('write');
|
||
|
navigator.serviceWorker.onmessage = (message) => {
|
||
|
if (message.data.type == 'written') {
|
||
|
worker.postMessage('read');
|
||
|
} else if (message.data.type == 'done') {
|
||
|
ok(message.data.cached, 'Write success');
|
||
|
resolve();
|
||
|
}
|
||
|
};
|
||
|
});
|
||
|
})
|
||
|
.then(done);
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body onload='runTests()'>
|
||
|
</body>
|
||
|
</html>
|