Skip to content

Commit 179f2ce

Browse files
committed
Refine custom test for InstallEvent
1 parent f9bcb66 commit 179f2ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

custom/tests.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,13 +3293,18 @@ api:
32933293
var instance = new InputEvent('input');
32943294
InstallEvent:
32953295
__base: |-
3296+
if (!('InstallEvent' in self)) {
3297+
return {result: false, message: 'InstallEvent is not defined'}
3298+
}
32963299
// During the installation of the service worker, we set an "installEvent" global variable so that we may easily reuse it here:
32973300
// var installEvent = null;
32983301
// self.addEventListener('install', function (event) {
32993302
// installEvent = event;
33003303
// });
3301-
3302-
var instance = installEvent;
3304+
if (!(installEvent instanceof InstallEvent)) {
3305+
return {result: false, message: 'install event has unexpected type: ' + installEvent.constructor.name}
3306+
}
3307+
var instance = installEvent instanceof InstallEvent ? installEvent : undefined;
33033308
IntersectionObserver:
33043309
IntersectionObserver:
33053310
__additional:

0 commit comments

Comments
 (0)