mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Update web-platform-tests to revision d5be80a86d4f938250c075ac12414ad47516969c
This commit is contained in:
parent
bb2c5e387f
commit
463b6d3b60
32 changed files with 454 additions and 43 deletions
|
@ -133225,6 +133225,18 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/css-scoping/slotted-placeholder.html": [
|
||||
[
|
||||
"/css/css-scoping/slotted-placeholder.html",
|
||||
[
|
||||
[
|
||||
"/css/css-scoping/slotted-placeholder-ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/css-scoping/slotted-specificity.html": [
|
||||
[
|
||||
"/css/css-scoping/slotted-specificity.html",
|
||||
|
@ -264959,6 +264971,11 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/css-scoping/slotted-placeholder-ref.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/css-scoping/slotted-with-pseudo-element-ref.html": [
|
||||
[
|
||||
{}
|
||||
|
@ -316554,11 +316571,21 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/js/worklet-recorder.js": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/refresh_idl.rb": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/resources/4ch-440.wav": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/resources/audio-param.js": [
|
||||
[
|
||||
{}
|
||||
|
@ -335024,6 +335051,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/CSS2/floats/computed-float-position-absolute.html": [
|
||||
[
|
||||
"/css/CSS2/floats/computed-float-position-absolute.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/CSS2/floats/zero-space-between-floats-001.html": [
|
||||
[
|
||||
"/css/CSS2/floats/zero-space-between-floats-001.html",
|
||||
|
@ -407804,12 +407837,24 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html",
|
||||
|
@ -490239,6 +490284,10 @@
|
|||
"59843ae54b64f6ce4f7e616d4be491c911ea84cf",
|
||||
"support"
|
||||
],
|
||||
"css/CSS2/floats/computed-float-position-absolute.html": [
|
||||
"ad9220b3a06085c458f7100c896100fb32f562e8",
|
||||
"testharness"
|
||||
],
|
||||
"css/CSS2/floats/float-nowrap-1-notref.html": [
|
||||
"540c8048af61a2c7804d99ff14c3a2bf1f87e6ad",
|
||||
"support"
|
||||
|
@ -559656,9 +559705,17 @@
|
|||
"testharness"
|
||||
],
|
||||
"css/css-scoping/slotted-parsing.html": [
|
||||
"308ff430449e4569abea713814f336eaa9e0e98a",
|
||||
"6888693bbf40932d62a19b535adba22adbd43b19",
|
||||
"testharness"
|
||||
],
|
||||
"css/css-scoping/slotted-placeholder-ref.html": [
|
||||
"f99c0385d061766b49d55e7703bf596fe69d6ec2",
|
||||
"support"
|
||||
],
|
||||
"css/css-scoping/slotted-placeholder.html": [
|
||||
"a3d607afb8e78e8c340b2d4c6ec86a5f4fc12190",
|
||||
"reftest"
|
||||
],
|
||||
"css/css-scoping/slotted-slot.html": [
|
||||
"1f4aa75ae60ec5ee5f6863aace8678584e4e6934",
|
||||
"testharness"
|
||||
|
@ -568152,7 +568209,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"css/css-transforms/parsing/scale-parsing-valid.html": [
|
||||
"89f79e2e85d35f1306577acfede9585b703a6c8f",
|
||||
"b9afbc848a3b5ff3033d070b4f080245e0d822c5",
|
||||
"testharness"
|
||||
],
|
||||
"css/css-transforms/parsing/transform-box-invalid.html": [
|
||||
|
@ -585472,7 +585529,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"css/filter-effects/META.yml": [
|
||||
"0098e6065a751201bceea961363181cb7180cbfa",
|
||||
"930b762b01a1a75e5b5ab4fb18dedd5939618fe1",
|
||||
"support"
|
||||
],
|
||||
"css/filter-effects/css-filters-animation-blur-ref.html": [
|
||||
|
@ -619696,7 +619753,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"html/semantics/forms/the-input-element/type-change-state.html": [
|
||||
"34cfd438cb6a68dc7b7e7204f8531b9553b689ad",
|
||||
"de068f17a735c09d9ed2727bbab45b102f3ad23e",
|
||||
"testharness"
|
||||
],
|
||||
"html/semantics/forms/the-input-element/url.html": [
|
||||
|
@ -637728,7 +637785,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"payment-request/META.yml": [
|
||||
"e608c0ee279fcb7987f9167f8223f3fedce66c33",
|
||||
"16738814437ab69e625ef79a42bb322152a5969f",
|
||||
"support"
|
||||
],
|
||||
"payment-request/MerchantValidationEvent/complete-method.https.html": [
|
||||
|
@ -647828,7 +647885,7 @@
|
|||
"support"
|
||||
],
|
||||
"resources/chromium/webxr-test.js": [
|
||||
"4b7707b49a556879137ac19b59bb5c454307fb56",
|
||||
"c6c21a6fed6c05a1981b9241d233a1b501fdf3ab",
|
||||
"support"
|
||||
],
|
||||
"resources/chromium/webxr-test.js.headers": [
|
||||
|
@ -662916,7 +662973,7 @@
|
|||
"support"
|
||||
],
|
||||
"tools/wpt/requirements.txt": [
|
||||
"c20f36f24647f26ad00e4508afaa798e1b6be0b1",
|
||||
"5610e90053f6bcab3d699fd2132aba5274818697",
|
||||
"support"
|
||||
],
|
||||
"tools/wpt/run.py": [
|
||||
|
@ -663044,7 +663101,7 @@
|
|||
"support"
|
||||
],
|
||||
"tools/wptrunner/requirements_sauce.txt": [
|
||||
"8ba53dafaa587dccd1f3dd3df23c5c62b78d22e6",
|
||||
"666db37ac1a4822250ee1dcdbf3c23e672a154e3",
|
||||
"support"
|
||||
],
|
||||
"tools/wptrunner/requirements_servo.txt": [
|
||||
|
@ -666432,7 +666489,7 @@
|
|||
"support"
|
||||
],
|
||||
"web-animations/animation-model/animation-types/property-types.js": [
|
||||
"e13cac067c489e4dab253d2f4aa5c793199e1704",
|
||||
"a71783b99e14322639251f5b58ede826696a7c3a",
|
||||
"support"
|
||||
],
|
||||
"web-animations/animation-model/animation-types/visibility.html": [
|
||||
|
@ -667003,10 +667060,18 @@
|
|||
"fbbfc8e00444dce1440fdbe8e28e11c5b064ce3d",
|
||||
"support"
|
||||
],
|
||||
"webaudio/js/worklet-recorder.js": [
|
||||
"3bf3bc23b20764ba54d5ff125699df91fffe741a",
|
||||
"support"
|
||||
],
|
||||
"webaudio/refresh_idl.rb": [
|
||||
"a07847535ad7cae63b06c3d30333819cfef08b77",
|
||||
"support"
|
||||
],
|
||||
"webaudio/resources/4ch-440.wav": [
|
||||
"85dc1ea9044e28eeeac6176bae61285c25ebf711",
|
||||
"support"
|
||||
],
|
||||
"webaudio/resources/audio-param.js": [
|
||||
"bc33fe8a21f5e7fcbe4e3d2d2a4c4c3b840d3072",
|
||||
"support"
|
||||
|
@ -667336,7 +667401,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-audioparam-interface/event-insertion.html": [
|
||||
"688d0478235e202859c7939eef65ad383f7a4f36",
|
||||
"07a54c3bbf68a7af3d651140df5ddcc99ac0f823",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-audioparam-interface/k-rate-audioworklet.https.html": [
|
||||
|
@ -667779,10 +667844,18 @@
|
|||
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
||||
"support"
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html": [
|
||||
"a2fa8040b2c6100f7ec22f0f133525808403ce01",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html": [
|
||||
"2c1162d47b973937c826caba0c740f58970defcc",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html": [
|
||||
"38324a9f67a67f50f134fb78af43117e2ec9b8c8",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/.gitkeep": [
|
||||
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
||||
"support"
|
||||
|
@ -668144,7 +668217,7 @@
|
|||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/element_click/interactability.py": [
|
||||
"702468599f3a379aa184821c84911531ba06ad31",
|
||||
"7463d493e3d8bd2b56c4b01ff5c9fd758c6fff03",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/element_click/navigate.py": [
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[computed-float-position-absolute.html]
|
||||
[The computed value of float with absolute positioning when there is no box should be "none"]
|
||||
expected: FAIL
|
||||
|
|
@ -509,7 +509,7 @@
|
|||
|
||||
|
||||
[single-byte-decoder.html?XMLHttpRequest]
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[ISO-8859-2: iso_8859-2:1987 (XMLHttpRequest)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_5.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
expected: NOTRUN
|
||||
|
||||
[calling play() on a sufficiently long video should trigger timeupdate event]
|
||||
expected: FAIL
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -13,3 +13,6 @@
|
|||
[picture: source (max-width:500px) valid image, img valid image, resize to narrow]
|
||||
expected: TIMEOUT
|
||||
|
||||
[picture: same URL in source (max-width:500px) and img, resize to narrow]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[parse-a-sizes-attribute-standards-mode.html]
|
||||
expected: TIMEOUT
|
||||
[<img srcset="/images/green-1x1.png?e59 50w, /images/green-16x16.png?e59 51w" sizes="(min-width:0) or (min-width:unknown-mf-value) 1px"> ref sizes="1px" (standards mode)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[toggleEvent.html]
|
||||
[Calling open twice on 'details' fires only one toggle event]
|
||||
expected: FAIL
|
||||
|
||||
[Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[quirks.html]
|
||||
[limited-quirks.html]
|
||||
[top: -\\31 .5]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
[realtimeanalyser-fft-scaling.html]
|
||||
expected: TIMEOUT
|
||||
[X 2048-point FFT peak position is not equal to 64. Got 0.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[cors-check.https.html]
|
||||
[\n Test if MediaElementAudioSourceNode works for cross-origin redirects with\n "cors" request mode.\n ]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[no-cors.https.html]
|
||||
[\n Test if MediaElementAudioSourceNode works for cross-origin redirects with\n "no-cors" request mode.\n ]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
[005.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
||||
[dedicated worker in shared worker in dedicated worker]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visuren.html" />
|
||||
<title>The computed value of float with absolute positioning when there is no box should be "none"</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
|
||||
div[id] {
|
||||
position: absolute;
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="test1" style="display: none"></div>
|
||||
<div id="test2" style="display: contents"></div>
|
||||
<div style="display: none"><div id="test3"></div></div>
|
||||
|
||||
<script>
|
||||
promise_test(
|
||||
t => {
|
||||
return new Promise(test => addEventListener('load', e=>test()))
|
||||
.then(test => assert_equals(getComputedStyle(test1)['float'], "none", "[display:none] Invalid gCS(test1)['float'];"))
|
||||
.then(test => assert_equals(getComputedStyle(test2)['float'], "none", "[display:contents] Invalid gCS(test2)['float'];"))
|
||||
.then(test => assert_equals(getComputedStyle(test3)['float'], "none", "[in a display:none] Invalid gCS(test3)['float'];"))
|
||||
}
|
||||
);
|
||||
</script>
|
|
@ -49,6 +49,8 @@
|
|||
// Allow tree-abiding pseudo elements after ::slotted
|
||||
test_valid_selector("::slotted(*)::before");
|
||||
test_valid_selector("::slotted(*)::after");
|
||||
test_valid_selector("::slotted(*)::placeholder");
|
||||
test_valid_selector("::slotted(*)::marker");
|
||||
|
||||
// Other pseudo elements not valid after ::slotted
|
||||
test_invalid_selector("::slotted(*)::first-line");
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
::placeholder { color: green }
|
||||
</style>
|
||||
<input placeholder="I should be green">
|
||||
<textarea placeholder="I should be green"></textarea>
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Scoping Test: ::slotted() allows ::placeholder</title>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
|
||||
<link rel="match" href="slotted-placeholder-ref.html">
|
||||
<div id="host">
|
||||
<input placeholder="I should be green">
|
||||
<textarea placeholder="I should be green"></textarea>
|
||||
</div>
|
||||
<script>
|
||||
host.attachShadow({ mode: "open" }).innerHTML = `
|
||||
<style>
|
||||
::slotted(*)::placeholder { color: green }
|
||||
</style>
|
||||
<slot></slot>
|
||||
`;
|
||||
</script>
|
|
@ -16,8 +16,10 @@ test_valid_value("scale", "none");
|
|||
|
||||
test_valid_value("scale", "1");
|
||||
|
||||
test_valid_value("scale", "100 100", "100");
|
||||
test_valid_value("scale", "100 200");
|
||||
|
||||
test_valid_value("scale", "100 200 1");
|
||||
test_valid_value("scale", "100 200 300");
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -3,3 +3,4 @@ suggested_reviewers:
|
|||
- svgeesus
|
||||
- grorg
|
||||
- dirkschulze
|
||||
- chrishtr
|
||||
|
|
|
@ -36,6 +36,17 @@
|
|||
const selectionEnd = 5;
|
||||
const selectionDirection = "backward";
|
||||
|
||||
// Obtain selectionDirection after setting it to "none".
|
||||
// Some platforms don't support "none" direction, and "forward" is returned
|
||||
// in such platforms.
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#set-the-selection-direction
|
||||
function testNoneDirection() {
|
||||
const input = document.createElement("input");
|
||||
input.selectionDirection = "none";
|
||||
return input.selectionDirection;
|
||||
}
|
||||
const noneDirectionResult = testNoneDirection();
|
||||
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
for (var j = 0; j < types.length; j++) {
|
||||
if (types[i] != types[j]) {
|
||||
|
@ -92,7 +103,8 @@
|
|||
} else {
|
||||
assert_equals(input.selectionStart, 0, "selectionStart should be 0");
|
||||
assert_equals(input.selectionEnd, 0, "selectionEnd should be 0");
|
||||
assert_equals(input.selectionDirection, "none", "selectionDirection should be 'none'");
|
||||
assert_equals(input.selectionDirection, noneDirectionResult,
|
||||
`selectionDirection should be '{noneDirectionResult}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@ suggested_reviewers:
|
|||
- mnoorenberghe
|
||||
- romandev
|
||||
- edenchuang
|
||||
- aestes
|
||||
|
|
|
@ -146,6 +146,10 @@ class MockRuntime {
|
|||
} else {
|
||||
this.displayInfo_ = this.getNonImmersiveDisplayInfo();
|
||||
}
|
||||
|
||||
if (fakeDeviceInit.supportsEnvironmentIntegration) {
|
||||
this.displayInfo_.capabilities.canProvideEnvironmentIntegration = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Test methods.
|
||||
|
@ -323,6 +327,12 @@ class MockRuntime {
|
|||
});
|
||||
}
|
||||
|
||||
getEnvironmentIntegrationProvider(environmentProviderRequest) {
|
||||
let environmentProviderBinding = new mojo.AssociatedBinding(
|
||||
device.mojom.XREnvironmentIntegrationProvider, this,
|
||||
environmentProviderRequest);
|
||||
}
|
||||
|
||||
updateSessionGeometry(frame_size, display_rotation) {
|
||||
// This function must exist to ensure that calls to it do not crash, but we
|
||||
// do not have any use for this data at present.
|
||||
|
@ -352,21 +362,12 @@ class MockRuntime {
|
|||
let dataProviderBinding = new mojo.Binding(
|
||||
device.mojom.XRFrameDataProvider, this, dataProviderRequest);
|
||||
|
||||
let environmentProviderPtr =
|
||||
new device.mojom.XREnvironmentIntegrationProviderPtr();
|
||||
let environmentProviderRequest =
|
||||
mojo.makeRequest(environmentProviderPtr);
|
||||
let environmentProviderBinding = new mojo.Binding(
|
||||
device.mojom.XREnvironmentIntegrationProvider, this,
|
||||
environmentProviderRequest);
|
||||
|
||||
let clientRequest = mojo.makeRequest(this.sessionClient_);
|
||||
|
||||
return Promise.resolve({
|
||||
session: {
|
||||
submitFrameSink: submit_frame_sink,
|
||||
dataProvider: dataProviderPtr,
|
||||
environmentProvider: environmentProviderPtr,
|
||||
clientRequest: clientRequest,
|
||||
displayInfo: this.displayInfo_
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
requests==2.20.0
|
||||
requests==2.20.1
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
mozprocess == 0.26
|
||||
selenium==3.141.0
|
||||
requests==2.20.0
|
||||
requests==2.20.1
|
||||
|
|
|
@ -1976,7 +1976,7 @@ const scaleListType = {
|
|||
1000);
|
||||
|
||||
testAnimationSamples(animation, idlName,
|
||||
[{ time: 500, expected: '4 4' }]);
|
||||
[{ time: 500, expected: '4' }]);
|
||||
}, `${property} with one unspecified value`);
|
||||
|
||||
test(t => {
|
||||
|
@ -2012,8 +2012,8 @@ const scaleListType = {
|
|||
composite: 'add' });
|
||||
|
||||
testAnimationSamples(animation, idlName,
|
||||
[{ time: 0, expected: '-6 -6' },
|
||||
{ time: 1000, expected: '10 10' }]);
|
||||
[{ time: 0, expected: '-6' },
|
||||
{ time: 1000, expected: '10' }]);
|
||||
}, `${property} with one unspecified value`);
|
||||
|
||||
test(t => {
|
||||
|
@ -2052,8 +2052,8 @@ const scaleListType = {
|
|||
composite: 'accumulate' });
|
||||
|
||||
testAnimationSamples(animation, idlName,
|
||||
[{ time: 0, expected: '-2 -2' },
|
||||
{ time: 1000, expected: '6 6' }]);
|
||||
[{ time: 0, expected: '-2' },
|
||||
{ time: 1000, expected: '6' }]);
|
||||
}, `${property} with one unspecified value`);
|
||||
|
||||
test(t => {
|
||||
|
|
54
tests/wpt/web-platform-tests/webaudio/js/worklet-recorder.js
Normal file
54
tests/wpt/web-platform-tests/webaudio/js/worklet-recorder.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* @class RecorderProcessor
|
||||
* @extends AudioWorkletProcessor
|
||||
*
|
||||
* A simple recorder AudioWorkletProcessor. Returns the recorded buffer to the
|
||||
* node when recording is finished.
|
||||
*/
|
||||
class RecorderProcessor extends AudioWorkletProcessor {
|
||||
/**
|
||||
* @param {*} options
|
||||
* @param {number} options.duration A duration to record in seconds.
|
||||
* @param {number} options.channelCount A channel count to record.
|
||||
*/
|
||||
constructor(options) {
|
||||
super();
|
||||
this._createdAt = currentTime;
|
||||
this._elapsed = 0;
|
||||
this._recordDuration = options.duration || 1;
|
||||
this._recordChannelCount = options.channelCount || 1;
|
||||
this._recordBufferLength = sampleRate * this._recordDuration;
|
||||
this._recordBuffer = [];
|
||||
for (let i = 0; i < this._recordChannelCount; ++i) {
|
||||
this._recordBuffer[i] = new Float32Array(this._recordBufferLength);
|
||||
}
|
||||
}
|
||||
|
||||
process(inputs, outputs) {
|
||||
if (this._recordBufferLength <= currentFrame) {
|
||||
this.port.postMessage({
|
||||
type: 'recordfinished',
|
||||
recordBuffer: this._recordBuffer
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Records the incoming data from |inputs| and also bypasses the data to
|
||||
// |outputs|.
|
||||
const input = inputs[0];
|
||||
const output = outputs[0];
|
||||
for (let channel = 0; channel < input.length; ++channel) {
|
||||
const inputChannel = input[channel];
|
||||
const outputChannel = output[channel];
|
||||
outputChannel.set(inputChannel);
|
||||
|
||||
const buffer = this._recordBuffer[channel];
|
||||
const capacity = buffer.length - currentFrame;
|
||||
buffer.set(inputChannel.slice(0, capacity), currentFrame);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
registerProcessor('recorder-processor', RecorderProcessor);
|
BIN
tests/wpt/web-platform-tests/webaudio/resources/4ch-440.wav
Normal file
BIN
tests/wpt/web-platform-tests/webaudio/resources/4ch-440.wav
Normal file
Binary file not shown.
|
@ -61,6 +61,13 @@
|
|||
extraArgs: RENDER_QUANTUM_FRAMES / context.sampleRate,
|
||||
outputTestFrame: 4 * RENDER_QUANTUM_FRAMES,
|
||||
expectedOutputValue: 4
|
||||
},
|
||||
{
|
||||
event: 'setValueAtTime',
|
||||
frame: 5 * RENDER_QUANTUM_FRAMES - 1,
|
||||
values: [99, 1, 5],
|
||||
outputTestFrame: 5 * RENDER_QUANTUM_FRAMES,
|
||||
expectedOutputValue: 5
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Test if MediaElementAudioSourceNode works for cross-origin redirects with
|
||||
"cors" request mode.
|
||||
</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/webaudio/resources/audit.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script id="layout-test-code">
|
||||
const audit = Audit.createTaskRunner();
|
||||
|
||||
const context = new AudioContext();
|
||||
context.suspend();
|
||||
|
||||
const host_info = get_host_info();
|
||||
const audioElement = document.createElement('audio');
|
||||
audioElement.loop = true;
|
||||
audioElement.crossOrigin = 'anonymous';
|
||||
const wav =
|
||||
host_info.HTTPS_ORIGIN + '/webaudio/resources/4ch-440.wav?' +
|
||||
'pipe=header(access-control-allow-origin,*)';
|
||||
audioElement.src =
|
||||
host_info.HTTPS_REMOTE_ORIGIN +
|
||||
'/fetch/api/resources/redirect.py?location=' +
|
||||
encodeURIComponent(wav);
|
||||
let source;
|
||||
let workletRecorder;
|
||||
|
||||
audit.define(
|
||||
{label: 'setting-up-graph'},
|
||||
(task, should) => {
|
||||
source = new MediaElementAudioSourceNode(context, {
|
||||
mediaElement: audioElement
|
||||
});
|
||||
workletRecorder = new AudioWorkletNode(
|
||||
context, 'recorder-processor', {channelCount: 4});
|
||||
source.connect(workletRecorder).connect(context.destination);
|
||||
task.done();
|
||||
});
|
||||
|
||||
// The recorded data from MESN must be non-zero. The source file contains
|
||||
// 4 channels of sine wave.
|
||||
audit.define(
|
||||
{label: 'start-playback-and-capture'},
|
||||
(task, should) => {
|
||||
workletRecorder.port.onmessage = (event) => {
|
||||
if (event.data.type === 'recordfinished') {
|
||||
for (let i = 0; i < event.data.recordBuffer.length; ++i) {
|
||||
const channelData = event.data.recordBuffer[i];
|
||||
should(channelData, `Recorded channel #${i}`)
|
||||
.notBeConstantValueOf(0);
|
||||
}
|
||||
}
|
||||
|
||||
task.done();
|
||||
};
|
||||
|
||||
context.resume();
|
||||
audioElement.play();
|
||||
});
|
||||
|
||||
Promise.all([
|
||||
context.audioWorklet.addModule('/webaudio/js/worklet-recorder.js')
|
||||
]).then(() => {
|
||||
audit.run();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Test if MediaElementAudioSourceNode works for cross-origin redirects with
|
||||
"no-cors" request mode.
|
||||
</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/webaudio/resources/audit.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script id="layout-test-code">
|
||||
const audit = Audit.createTaskRunner();
|
||||
|
||||
const context = new AudioContext();
|
||||
context.suspend();
|
||||
|
||||
const host_info = get_host_info();
|
||||
const audioElement = document.createElement('audio');
|
||||
audioElement.loop = true;
|
||||
const wav =
|
||||
host_info.HTTPS_ORIGIN + '/webaudio/resources/4ch-440.wav?' +
|
||||
'pipe=header(access-control-allow-origin,*)';
|
||||
audioElement.src =
|
||||
host_info.HTTPS_REMOTE_ORIGIN +
|
||||
'/fetch/api/resources/redirect.py?location=' +
|
||||
encodeURIComponent(wav);
|
||||
let source;
|
||||
let workletRecorder;
|
||||
|
||||
audit.define(
|
||||
{label: 'setting-up-graph'},
|
||||
(task, should) => {
|
||||
source = new MediaElementAudioSourceNode(context, {
|
||||
mediaElement: audioElement
|
||||
});
|
||||
workletRecorder = new AudioWorkletNode(
|
||||
context, 'recorder-processor', {channelCount: 4});
|
||||
source.connect(workletRecorder).connect(context.destination);
|
||||
task.done();
|
||||
});
|
||||
|
||||
// The recorded data from MESN must be non-zero. The source file contains
|
||||
// 4 channels of sine wave.
|
||||
audit.define(
|
||||
{label: 'start-playback-and-capture'},
|
||||
(task, should) => {
|
||||
workletRecorder.port.onmessage = (event) => {
|
||||
if (event.data.type === 'recordfinished') {
|
||||
for (let i = 0; i < event.data.recordBuffer.length; ++i) {
|
||||
const channelData = event.data.recordBuffer[i];
|
||||
should(channelData, `Recorded channel #${i}`)
|
||||
.beConstantValueOf(0);
|
||||
}
|
||||
}
|
||||
|
||||
task.done();
|
||||
};
|
||||
|
||||
context.resume();
|
||||
audioElement.play();
|
||||
});
|
||||
|
||||
Promise.all([
|
||||
context.audioWorklet.addModule('/webaudio/js/worklet-recorder.js')
|
||||
]).then(() => {
|
||||
audit.run();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -57,10 +57,17 @@ def test_element_not_interactable_css_transform(session, transform):
|
|||
|
||||
def test_element_not_interactable_out_of_view(session):
|
||||
session.url = inline("""
|
||||
<div style="width: 500px; height: 100px;
|
||||
position: absolute; left: 0px; top: -150px; background-color: blue;">
|
||||
</div>""")
|
||||
element = session.find.css("div", all=False)
|
||||
<style>
|
||||
input {
|
||||
position: absolute;
|
||||
margin-top: -100vh;
|
||||
background: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<input>
|
||||
""")
|
||||
element = session.find.css("input", all=False)
|
||||
response = element_click(session, element)
|
||||
assert_error(response, "element not interactable")
|
||||
|
||||
|
@ -76,9 +83,20 @@ def test_zero_sized_element(session, tag_name):
|
|||
|
||||
def test_element_intercepted(session):
|
||||
session.url = inline("""
|
||||
<input type=button value=Roger style="position: absolute; left: 10px; top: 10px">
|
||||
<div style="position: absolute; height: 100px; width: 100px; background: rgba(255,0,0,.5); left: 10px; top: 5px"></div>""")
|
||||
<style>
|
||||
div {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vh;
|
||||
background: blue;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<input type=button value=Roger>
|
||||
<div></div>
|
||||
""")
|
||||
element = session.find.css("input", all=False)
|
||||
response = element_click(session, element)
|
||||
assert_error(response, "element click intercepted")
|
||||
|
@ -86,7 +104,6 @@ def test_element_intercepted(session):
|
|||
|
||||
def test_element_intercepted_no_pointer_events(session):
|
||||
session.url = inline("""<input type=button value=Roger style="pointer-events: none">""")
|
||||
|
||||
element = session.find.css("input", all=False)
|
||||
response = element_click(session, element)
|
||||
assert_error(response, "element click intercepted")
|
||||
|
@ -94,11 +111,21 @@ def test_element_intercepted_no_pointer_events(session):
|
|||
|
||||
def test_element_not_visible_overflow_hidden(session):
|
||||
session.url = inline("""
|
||||
<div style="position: absolute; height: 50px; width: 100px; background: rgba(255,0,0,.5); left: 10px; top: 50px; overflow: hidden">
|
||||
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
<input type=text value=Federer style="position: absolute; top: 50px; left: 10px;">
|
||||
</div>""")
|
||||
<style>
|
||||
div {
|
||||
overflow: hidden;
|
||||
height: 50px;
|
||||
background: green;
|
||||
}
|
||||
|
||||
input {
|
||||
margin-top: 100px;
|
||||
background: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div><input></div>
|
||||
""")
|
||||
element = session.find.css("input", all=False)
|
||||
response = element_click(session, element)
|
||||
assert_error(response, "element not interactable")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue