Skip to content

Commit

Permalink
Update test for InstallEvent to use real event instead
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg committed May 20, 2023
1 parent eeb4a65 commit 8777c0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions custom/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2352,12 +2352,17 @@ api:
return {result: false, message: 'navigator.ink.requestPresenter() is not defined'};
}
var promise = navigator.ink.requestPresenter();
InputDeviceInfo:
__base: <%api.MediaDeviceInfo:instance%>
InstallEvent:
__base: |-
if (!('InstallEvent' in self)) {
return {result: false, message: 'InstallEvent is not defined'};
}
var instance = new InstallEvent('install');
// During the installation of the service worker, we set an "installEvent" global variable so that we may easily reuse it here:
// var installEvent = null;
// self.addEventListener('install', function (event) {
// installEvent = event;
// });
var instance = installEvent;
InterventionReportBody:
__base: |-
// XXX Obtaining an instance of this interface is much like triggering an event.
Expand Down
3 changes: 3 additions & 0 deletions static/resources/serviceworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

self.importScripts('harness.js');

var installEvent = null;

self.addEventListener('install', function (event) {
installEvent = event;
var promiseChain = caches.open('test-cache').then(function (openCache) {
return openCache.put(new Request(''), new Response(''));
});
Expand Down

0 comments on commit 8777c0f

Please sign in to comment.