mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
* Deps and config * Prettier output * Update hardcoded file sizes * More file size updates
46 lines
1.4 KiB
HTML
46 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
-->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Workbox Integration Tests</title>
|
|
|
|
<!-- Uncomment when locally running the module versions. -->
|
|
<!-- <script>self.process = self.process || {env: {NODE_ENV: 'dev'}};</script> -->
|
|
|
|
<script src="/node_modules/sinon/pkg/sinon.js"></script>
|
|
<script src="/node_modules/chai/chai.js"></script>
|
|
<script>
|
|
self.expect = self.chai.expect;
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p>You need to manually register a service worker</p>
|
|
|
|
<script type="module">
|
|
import {Workbox} from '/__WORKBOX/buildFile/workbox-window';
|
|
|
|
// Expose on the global object so it can be referenced by webdriver.
|
|
window.Workbox = Workbox;
|
|
|
|
// Returns a promise that resolves when both the activated and controlling
|
|
// events have fired on the Workbox object.
|
|
window.activatedAndControlling = (wb) => {
|
|
const activatedPromise = new Promise((resolve) => {
|
|
wb.addEventListener('activated', () => resolve());
|
|
});
|
|
const controllingPromise = new Promise((resolve) => {
|
|
wb.addEventListener('controlling', () => resolve());
|
|
});
|
|
return Promise.all([activatedPromise, controllingPromise]);
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|