forked from web-platform-tests/wpt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the secure-contexts IDL file and test (web-platform-tests#9848)
- Loading branch information
1 parent
ca38b10
commit fee0710
Showing
2 changed files
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// GENERATED CONTENT - DO NOT EDIT | ||
// Content of this file was automatically extracted from the | ||
// "Secure Contexts" spec. | ||
// See: https://w3c.github.io/webappsec-secure-contexts/ | ||
|
||
partial interface WindowOrWorkerGlobalScope { | ||
readonly attribute boolean isSecureContext; | ||
}; |
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,20 @@ | ||
// META: global=window,worker | ||
// META: script=/resources/WebIDLParser.js | ||
// META: script=/resources/idlharness.js | ||
|
||
// https://w3c.github.io/webappsec-secure-contexts/ | ||
|
||
'use strict'; | ||
|
||
promise_test(async () => { | ||
const idl = await fetch("/interfaces/secure-contexts.idl").then(r => r.text()); | ||
const workers = await fetch("/interfaces/dedicated-workers.idl").then(r => r.text()); | ||
|
||
const idl_array = new IdlArray(); | ||
idl_array.add_idls(idl); | ||
idl_array.add_dependency_idls(workers); | ||
idl_array.add_objects({ | ||
WindowOrWorkerGlobalScope: ["self"], | ||
}); | ||
idl_array.test(); | ||
}, "Test IDL implementation of Secure Contexts"); |