-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d76f5cf
commit 94dca79
Showing
14 changed files
with
306 additions
and
48 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,19 @@ | ||
// META: global=window,worker | ||
// META: script=/common/gc.js | ||
|
||
promise_test(async () => { | ||
let i = 0; | ||
const repeat = 5; | ||
const buffer = await new Response(new ReadableStream({ | ||
pull(c) { | ||
if (i >= repeat) { | ||
c.close(); | ||
return; | ||
} | ||
++i; | ||
c.enqueue(new Uint8Array([0])) | ||
garbageCollect(); | ||
} | ||
})).arrayBuffer(); | ||
assert_equals(buffer.byteLength, repeat, `The buffer should be ${repeat}-byte long`); | ||
}, "GC/CC should not abruptly close the stream while being consumed by Response"); |
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,54 @@ | ||
// GENERATED CONTENT - DO NOT EDIT | ||
// Content was automatically extracted by Reffy into webref | ||
// (https://github.com/w3c/webref) | ||
// Source: CSS Fonts Module Level 5 (https://drafts.csswg.org/css-fonts-5/) | ||
|
||
[Exposed=Window] | ||
interface CSSFontFaceDescriptors : CSSStyleDeclaration { | ||
attribute [LegacyNullToEmptyString] CSSOMString src; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontFamily; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-family; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontStyle; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-style; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontWeight; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-weight; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontStretch; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-stretch; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontWidth; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-width; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontSize; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-size; | ||
attribute [LegacyNullToEmptyString] CSSOMString sizeAdjust; | ||
attribute [LegacyNullToEmptyString] CSSOMString size-adjust; | ||
attribute [LegacyNullToEmptyString] CSSOMString unicodeRange; | ||
attribute [LegacyNullToEmptyString] CSSOMString unicode-range; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontFeatureSettings; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-feature-settings; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontVariationSettings; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-variation-settings; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontNamedInstance; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-named-instance; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontDisplay; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-display; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontLanguageOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString font-language-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString ascentOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString ascent-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString descentOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString descent-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString line-gap-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString superscriptPositionOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString superscript-position-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString subscriptPositionOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString subscript-position-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString superscriptSizeOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString superscript-size-override; | ||
attribute [LegacyNullToEmptyString] CSSOMString subscriptSizeOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString subscript-size-override; | ||
}; | ||
|
||
[Exposed=Window] | ||
interface CSSFontFaceRule : CSSRule { | ||
[SameObject, PutForwards=cssText] readonly attribute CSSFontFaceDescriptors style; | ||
}; |
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
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
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
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
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
11 changes: 11 additions & 0 deletions
11
test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe-worker.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,11 @@ | ||
self.addEventListener('message', event => { | ||
event.source.postMessage('passed'); | ||
}); | ||
|
||
self.addEventListener('fetch', event => { | ||
let url = new URL(event.request.url); | ||
if (!url.searchParams.get('test_resource')) { | ||
return; | ||
} | ||
event.respondWith(new Response('passed')); | ||
}); |
92 changes: 92 additions & 0 deletions
92
test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe.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,92 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
<iframe id="srcdocFrame" srcdoc=" | ||
<script> | ||
function reportTestResult(result) { | ||
top.postMessage({ type: 'TEST_RESULT', result: result }, '*'); | ||
} | ||
async function postMessageToController() { | ||
let controller = navigator.serviceWorker.controller; | ||
if (!controller) { | ||
reportTestResult('no navigator.serviceWorker.controller'); | ||
} | ||
try { | ||
controller.postMessage('test'); | ||
} catch (e) { | ||
reportTestResult('Unexpected Error ' + e.name + ' : ' + e.message); | ||
} | ||
} | ||
async function getServiceWorkerRegistration(scope) { | ||
try { | ||
let reg = await navigator.serviceWorker.getRegistration(scope); | ||
if (!reg) { | ||
reportTestResult('no regsitration for ' + scope); | ||
} | ||
if (reg.scope !== scope) { | ||
reportTestResult('regsitration scope does not match'); | ||
} | ||
if (!reg.active) { | ||
reportTestResult('regsitration.active is not valid' + reg.active); | ||
} | ||
reportTestResult('passed'); | ||
} catch (e) { | ||
reportTestResult('Unexpected Error ' + e.name + ' : ' + e.message); | ||
} | ||
} | ||
function addSrcdocIframeWithSandbox(sandbox) { | ||
let frame = document.createElement('iframe'); | ||
frame.sandbox = sandbox; | ||
frame.srcdoc = ` | ||
<script> | ||
function reportTestResult(result) { | ||
top.postMessage({ type: 'TEST_RESULT', result: result }, '*'); | ||
} | ||
window.onload = function onLoad() { | ||
try { | ||
let controller = navigator.serviceWorker.controller; | ||
reportTestResult(controller ? 'HasController' : 'NoController'); | ||
} catch (e) { | ||
reportTestResult((e.name == 'SecurityError') ? | ||
'NoController' : 'UnexpectedError:' + e.message); | ||
} | ||
} | ||
<\/script>`; | ||
document.body.appendChild(frame); | ||
} | ||
function addSandboxedSrcdocFrame() { | ||
addSrcdocIframeWithSandbox('allow-scripts'); | ||
} | ||
function addSameOriginSandboxedSrcdocFrame() { | ||
addSrcdocIframeWithSandbox('allow-scripts allow-same-origin'); | ||
} | ||
async function fetchResource() { | ||
let response = await fetch('?test_resource=1'); | ||
reportTestResult(await response.text()); | ||
} | ||
window.navigator.serviceWorker.addEventListener( | ||
'message', function onMsg(evt) { | ||
// Forward the message as test result. | ||
reportTestResult(evt.data); | ||
}); | ||
</script> | ||
"></iframe> | ||
|
||
<script> | ||
// Helper routine to make it slightly easier for our parent to find | ||
// the srcdoc frame. | ||
function srcdocFrame() { | ||
return document.getElementById('srcdocFrame').contentWindow; | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.