Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update web-platform-tests to revision a8fb1792cbfab3ed59401775da76fb6…
…c15d9f2e2
- Loading branch information
1 parent
1bac32e
commit 642f3cb
Showing
2,857 changed files
with
299,597 additions
and
289,556 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
6 changes: 6 additions & 0 deletions
6
tests/wpt/web-platform-tests/.well-known/origin-policy/policy-features
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,6 @@ | ||
{ | ||
"feature-policy": [ | ||
"camera 'self' https://example.org", | ||
"geolocation https://example.org/" | ||
] | ||
} |
55 changes: 55 additions & 0 deletions
55
tests/wpt/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin.html
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,55 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>IDBFactory.databases() and opaque origins</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
|
||
function load_iframe(src, sandbox) { | ||
return new Promise(resolve => { | ||
const iframe = document.createElement('iframe'); | ||
iframe.onload = () => { resolve(iframe); }; | ||
if (sandbox) | ||
iframe.sandbox = sandbox; | ||
iframe.srcdoc = src; | ||
iframe.style.display = 'none'; | ||
document.documentElement.appendChild(iframe); | ||
}); | ||
} | ||
|
||
function wait_for_message(iframe) { | ||
return new Promise(resolve => { | ||
self.addEventListener('message', function listener(e) { | ||
if (e.source === iframe.contentWindow) { | ||
resolve(e.data); | ||
self.removeEventListener('message', listener); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
const script = | ||
'<script>' + | ||
' window.onmessage = () => {' + | ||
' indexedDB.databases().then(' + | ||
' () => window.parent.postMessage({result: "no exception"}, "*"),' + | ||
' ex => window.parent.postMessage({result: ex.name}, "*"));' + | ||
' };' + | ||
'<\/script>'; | ||
|
||
promise_test(async t => { | ||
const iframe = await load_iframe(script); | ||
iframe.contentWindow.postMessage({}, '*'); | ||
const message = await wait_for_message(iframe); | ||
assert_equals(message.result, 'no exception', | ||
'IDBFactory.databases() should not reject'); | ||
}, 'IDBFactory.databases() in non-sandboxed iframe should not reject'); | ||
|
||
promise_test(async t => { | ||
const iframe = await load_iframe(script, 'allow-scripts'); | ||
iframe.contentWindow.postMessage({}, '*'); | ||
const message = await wait_for_message(iframe); | ||
assert_equals(message.result, 'SecurityError', | ||
'Exception should be SecurityError'); | ||
}, 'IDBFactory.databases() in sandboxed iframe should reject'); | ||
</script> |
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
23 changes: 23 additions & 0 deletions
23
tests/wpt/web-platform-tests/background-fetch/fetch-uploads.https.window.js
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,23 @@ | ||
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js | ||
// META: script=resources/utils.js | ||
'use strict'; | ||
|
||
// Covers basic functionality provided by BackgroundFetchManager.fetch(). | ||
// Specifically, when `fetch` contains request uploads. | ||
// https://wicg.github.io/background-fetch/#background-fetch-manager-fetch | ||
|
||
backgroundFetchTest(async (test, backgroundFetch) => { | ||
const uploadData = 'Background Fetch!'; | ||
const request = | ||
new Request('resources/upload.py', {method: 'POST', body: uploadData}); | ||
|
||
await backgroundFetch.fetch(uniqueId(), request); | ||
const {type, eventRegistration, results} = await getMessageFromServiceWorker(); | ||
|
||
assert_equals(type, 'backgroundfetchsuccess'); | ||
assert_equals(results.length, 1); | ||
assert_equals(eventRegistration.result, 'success'); | ||
assert_equals(eventRegistration.failureReason, ''); | ||
assert_equals(results[0].text, uploadData); | ||
|
||
}, 'Fetch with an upload should work'); |
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
3 changes: 3 additions & 0 deletions
3
tests/wpt/web-platform-tests/background-fetch/resources/upload.py
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,3 @@ | ||
# Simply returns the request body to check if the upload succeeded. | ||
def main(request, response): | ||
return 200, [("Content-Type", request.headers['content-type'])], request.body |
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
Oops, something went wrong.