swh:1:snp:b37d435721bbd450624165f334724e3585346499
Raw File
Tip revision: 2b8a5ccbad0af75dceea3357c44a81ce0c39cb0a authored by Mason Freed on 13 December 2018, 18:21:43 UTC
Revert "Implement correct opacity and filter handling within backdrop-filter"
Tip revision: 2b8a5cc
idlharness.https.any.js
// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

'use strict';

// https://notifications.spec.whatwg.org/

idl_test(
  ['notifications'],
  ['service-workers', 'html', 'dom'],
  idl_array => {
    if (self.ServiceWorkerGlobalScope) {
      idl_array.add_objects({
        ServiceWorkerGlobalScope: ['self'],
      });
      // NotificationEvent could be tested here, but the constructor requires
      // a Notification instance which cannot be created in a service worker,
      // see below.
    } else {
      // While the Notification interface is exposed in service workers, the
      // constructor (https://notifications.spec.whatwg.org/#dom-notification-notification)
      // is defined to throw a TypeError. Therefore, we only add the object in
      // the other scopes.
      idl_array.add_objects({
        Notification: ['notification'],
      });
      self.notification = new Notification('title');
    }
  }
);
back to top