forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for notification inline reply idl properties
- Migrated existing html test to .any.js test + .idl interface to allow testing the new properties from a service worker scope. - See whatwg/notifications#132 for the spec change this tests. - See https://github.com/anitawoodruff/inline-notification-replies for an Explainer.
- Loading branch information
Anita Woodruff
committed
May 23, 2018
1 parent
31c2aeb
commit e987260
Showing
3 changed files
with
113 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// META: global=worker | ||
// META: script=/resources/WebIDLParser.js | ||
// META: script=/resources/idlharness.js | ||
|
||
// See https://notifications.spec.whatwg.org/ | ||
|
||
// This file's contents are duplicated in notifications/interfaces.https.any.js | ||
// as a workaround for https://github.com/w3c/web-platform-tests/issues/11105 | ||
|
||
"use strict"; | ||
|
||
promise_test(async () => { | ||
const sw_idl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); | ||
const dedicated_workers_idl = await fetch('/interfaces/dedicated-workers.idl').then(r => r.text()); | ||
const dom_idl = await fetch('/interfaces/dom.idl').then(r => r.text()); | ||
|
||
const notifications_idl = await fetch('/interfaces/notifications.idl').then(r => r.text()); | ||
|
||
var idlArray = new IdlArray(); | ||
|
||
idlArray.add_untested_idls(sw_idl, { only: [ | ||
'ServiceWorkerRegistration', | ||
'ServiceWorkerGlobalScope', | ||
'ExtendableEvent', | ||
'ExtendableEventInit', | ||
] }); | ||
|
||
idlArray.add_untested_idls(dedicated_workers_idl); | ||
idlArray.add_untested_idls(dom_idl, { only: [ 'Event', 'EventInit' ] }); | ||
|
||
idlArray.add_idls(notifications_idl); | ||
|
||
if (!self.GLOBAL.isWorker()) { | ||
idlArray.add_objects({ | ||
Notification: ['new Notification("Running idlharness.")'], | ||
}); | ||
} | ||
|
||
idlArray.test(); | ||
done(); | ||
}, 'notifications interfaces.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// META: global=worker | ||
// META: script=/resources/WebIDLParser.js | ||
// META: script=/resources/idlharness.js | ||
|
||
// See https://notifications.spec.whatwg.org/ | ||
|
||
// The contents of this file are duplicated in notifications/interfaces.any.js | ||
// as a workaround for https://github.com/w3c/web-platform-tests/issues/11105 | ||
"use strict"; | ||
|
||
promise_test(async () => { | ||
const sw_idl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); | ||
const dedicated_workers_idl = await fetch('/interfaces/dedicated-workers.idl').then(r => r.text()); | ||
const dom_idl = await fetch('/interfaces/dom.idl').then(r => r.text()); | ||
|
||
const notifications_idl = await fetch('/interfaces/notifications.idl').then(r => r.text()); | ||
|
||
var idlArray = new IdlArray(); | ||
|
||
idlArray.add_untested_idls(sw_idl, { only: [ | ||
'ServiceWorkerRegistration', | ||
'ServiceWorkerGlobalScope', | ||
'ExtendableEvent', | ||
'ExtendableEventInit', | ||
] }); | ||
|
||
idlArray.add_untested_idls(dedicated_workers_idl); | ||
idlArray.add_untested_idls(dom_idl, { only: [ 'Event', 'EventInit' ] }); | ||
|
||
idlArray.add_idls(notifications_idl); | ||
|
||
if (!self.GLOBAL.isWorker()) { | ||
idlArray.add_objects({ | ||
Notification: ['new Notification("Running idlharness.")'], | ||
}); | ||
} | ||
|
||
idlArray.test(); | ||
done(); | ||
}, 'notifications interfaces.'); |