tenfourfox/dom/workers/test/serviceworkers/app-protocol/index.html
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

32 lines
784 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Test app for bug 1161684</title>
<script src='test.js'></script>
<script type='application/javascript;version=1.7'>
function registerServiceWorker() {
return new Promise((resolve, reject) => {
navigator.serviceWorker.ready.then(() => {
resolve();
});
navigator.serviceWorker.register('sw.js', {scope: '.'})
.then(registration => {
ok(true, 'service worker registered');
})
.catch(reject);
});
}
function runTests() {
return Promise.resolve()
.then(() => { return testFetchAppResource('foo.txt',
'networkresponse'); })
.then(registerServiceWorker)
.then(ready);
}
</script>
</head>
<body onload='runTests()'>
</body>
</html>