Update web-platform-tests to revision b'bcf4a27c0a9dbb07d974a880acb26eb289a85c7e'

This commit is contained in:
WPT Sync Bot 2023-02-17 01:49:27 +00:00
parent 293c8623fa
commit 61b963c73e
183 changed files with 3880 additions and 1012 deletions

View file

@ -0,0 +1,7 @@
[url-charset.window.html]
expected: TIMEOUT
[Blob charset should override any auto-detected charset.]
expected: TIMEOUT
[Blob charset should override <meta charset>.]
expected: TIMEOUT

View file

@ -7,7 +7,7 @@
expected: FAIL expected: FAIL
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: FAIL expected: TIMEOUT
[Opening a blob URL in a noopener about:blank window immediately before revoking it works.] [Opening a blob URL in a noopener about:blank window immediately before revoking it works.]
expected: TIMEOUT expected: TIMEOUT

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
[hit-test-floats-002.html]
[Hit test float]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,3 +0,0 @@
[block-in-inline-hittest-001.html]
[block-in-inline-hittest-001]
expected: FAIL

View file

@ -0,0 +1,2 @@
[attribute-value-selector-004.xht]
expected: TIMEOUT

View file

@ -0,0 +1,3 @@
[hittest-before-pseudo.html]
[Hit-testing text within a pseudo-element flex-item should return the flexbox as the hittest result.]
expected: FAIL

View file

@ -68,9 +68,6 @@
[Matching font-style: 'italic' should prefer 'oblique 20deg' over 'oblique 30deg 60deg'] [Matching font-style: 'italic' should prefer 'oblique 20deg' over 'oblique 30deg 60deg']
expected: FAIL expected: FAIL
[Matching font-stretch: '100%' should prefer '100%' over '110% 120%']
expected: FAIL
[Matching font-style: 'normal' should prefer 'oblique 10deg 40deg' over 'oblique 20deg 30deg'] [Matching font-style: 'normal' should prefer 'oblique 10deg 40deg' over 'oblique 20deg 30deg']
expected: FAIL expected: FAIL
@ -113,9 +110,6 @@
[Matching font-style: 'oblique 21deg' should prefer 'oblique 21deg' over 'oblique 30deg 60deg'] [Matching font-style: 'oblique 21deg' should prefer 'oblique 21deg' over 'oblique 30deg 60deg']
expected: FAIL expected: FAIL
[Matching font-style: 'italic' should prefer 'oblique 5deg 10deg' over 'oblique 5deg']
expected: FAIL
[Matching font-style: 'oblique 10deg' should prefer 'oblique 0deg' over 'oblique -50deg -20deg'] [Matching font-style: 'oblique 10deg' should prefer 'oblique 0deg' over 'oblique -50deg -20deg']
expected: FAIL expected: FAIL
@ -155,9 +149,6 @@
[Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%'] [Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%']
expected: FAIL expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'italic' over 'oblique 0deg']
expected: FAIL
[Matching font-style: 'italic' should prefer 'italic' over 'oblique 20deg'] [Matching font-style: 'italic' should prefer 'italic' over 'oblique 20deg']
expected: FAIL expected: FAIL
@ -233,9 +224,6 @@
[Matching font-stretch: '110%' should prefer '100%' over '50% 80%'] [Matching font-stretch: '110%' should prefer '100%' over '50% 80%']
expected: FAIL expected: FAIL
[Matching font-style: 'oblique 10deg' should prefer 'oblique 10deg' over 'oblique 5deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -1deg 0deg' over 'oblique -20deg -15deg'] [Matching font-style: 'oblique -10deg' should prefer 'oblique -1deg 0deg' over 'oblique -20deg -15deg']
expected: FAIL expected: FAIL
@ -248,9 +236,6 @@
[Matching font-style: 'oblique -21deg' should prefer 'oblique 0deg' over 'oblique 30deg 60deg'] [Matching font-style: 'oblique -21deg' should prefer 'oblique 0deg' over 'oblique 30deg 60deg']
expected: FAIL expected: FAIL
[Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -60deg -30deg' over 'oblique -50deg -40deg'] [Matching font-style: 'oblique -10deg' should prefer 'oblique -60deg -30deg' over 'oblique -50deg -40deg']
expected: FAIL expected: FAIL
@ -319,3 +304,18 @@
[Matching font-style: 'oblique 0deg' should prefer 'oblique 40deg 50deg' over 'italic'] [Matching font-style: 'oblique 0deg' should prefer 'oblique 40deg 50deg' over 'italic']
expected: FAIL expected: FAIL
[Matching font-weight: '501' should prefer '450 460' over '390 410']
expected: FAIL
[Matching font-style: 'italic' should prefer 'oblique 40deg 50deg' over 'oblique 5deg 10deg']
expected: FAIL
[Matching font-style: 'oblique 10deg' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg']
expected: FAIL
[Matching font-style: 'oblique 0deg' should prefer 'oblique 5deg' over 'oblique 15deg 20deg']
expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'oblique -10deg' over 'italic']
expected: FAIL

View file

@ -1,3 +1,6 @@
[transform-scale-hittest.html] [transform-scale-hittest.html]
[Hit test intersecting scaled box] [Hit test intersecting scaled box]
expected: FAIL expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -25,4 +25,3 @@
[padding-top percentage(%) / values] [padding-top percentage(%) / values]
expected: [FAIL, PASS] expected: [FAIL, PASS]

View file

@ -325,3 +325,153 @@
[margin-right length(mm) / values] [margin-right length(mm) / values]
expected: [FAIL, PASS] expected: [FAIL, PASS]
[color color(rgba) / values]
expected: FAIL
[font-size length(pt) / values]
expected: FAIL
[font-size length(pc) / values]
expected: FAIL
[font-size length(px) / values]
expected: FAIL
[font-size length(em) / values]
expected: FAIL
[font-size length(ex) / values]
expected: FAIL
[font-size length(mm) / values]
expected: FAIL
[font-size length(cm) / values]
expected: FAIL
[font-size length(in) / values]
expected: FAIL
[font-size percentage(%) / values]
expected: FAIL
[font-weight font-weight(keyword) / values]
expected: FAIL
[font-weight font-weight(numeric) / values]
expected: FAIL
[line-height number(integer) / values]
expected: FAIL
[line-height number(decimal) / values]
expected: FAIL
[line-height length(pt) / values]
expected: FAIL
[line-height length(pc) / values]
expected: FAIL
[line-height length(px) / values]
expected: FAIL
[line-height length(em) / values]
expected: FAIL
[line-height length(ex) / values]
expected: FAIL
[line-height length(mm) / values]
expected: FAIL
[line-height length(cm) / values]
expected: FAIL
[line-height length(in) / values]
expected: FAIL
[line-height percentage(%) / values]
expected: FAIL
[letter-spacing length(pt) / values]
expected: FAIL
[letter-spacing length(pc) / values]
expected: FAIL
[letter-spacing length(px) / values]
expected: FAIL
[letter-spacing length(em) / values]
expected: FAIL
[letter-spacing length(ex) / values]
expected: FAIL
[letter-spacing length(mm) / values]
expected: FAIL
[letter-spacing length(cm) / values]
expected: FAIL
[letter-spacing length(in) / values]
expected: FAIL
[word-spacing length(pt) / values]
expected: FAIL
[word-spacing length(pc) / values]
expected: FAIL
[word-spacing length(px) / values]
expected: FAIL
[word-spacing length(em) / values]
expected: FAIL
[word-spacing length(ex) / values]
expected: FAIL
[word-spacing length(mm) / values]
expected: FAIL
[word-spacing length(cm) / values]
expected: FAIL
[word-spacing length(in) / values]
expected: FAIL
[word-spacing percentage(%) / values]
expected: FAIL
[text-indent length(pt) / values]
expected: FAIL
[text-indent length(pc) / values]
expected: FAIL
[text-indent length(px) / values]
expected: FAIL
[text-indent length(em) / values]
expected: FAIL
[text-indent length(ex) / values]
expected: FAIL
[text-indent length(mm) / values]
expected: FAIL
[text-indent length(cm) / values]
expected: FAIL
[text-indent length(in) / values]
expected: FAIL
[text-indent percentage(%) / values]
expected: FAIL
[text-shadow shadow(shadow) / values]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-float-in-table.html]
[float-in-div]
expected: FAIL

View file

@ -13,6 +13,3 @@
[<li>Outside 3</li>] [<li>Outside 3</li>]
expected: FAIL expected: FAIL
[<li>Image Inside 2</li>]
expected: FAIL

View file

@ -18,5 +18,5 @@
[test some point of the element: bottom right corner] [test some point of the element: bottom right corner]
expected: FAIL expected: FAIL
[test some point of the element: top left corner] [test the top of layer]
expected: FAIL expected: FAIL

View file

@ -147,5 +147,5 @@
[list-style-image sec-fetch-site - HTTPS downgrade-upgrade] [list-style-image sec-fetch-site - HTTPS downgrade-upgrade]
expected: FAIL expected: FAIL
[background-image sec-fetch-site - Not sent to non-trustworthy cross-site destination] [background-image sec-fetch-site - HTTPS downgrade (header not sent)]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,6 +1,6 @@
[scroll-restoration-fragment-scrolling-cross-origin.html] [scroll-restoration-fragment-scrolling-cross-origin.html]
type: testharness type: testharness
expected: TIMEOUT expected: ERROR
[Manual scroll restoration should take precedent over scrolling to fragment in cross origin navigation] [Manual scroll restoration should take precedent over scrolling to fragment in cross origin navigation]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,3 +1,4 @@
[005.html] [005.html]
expected: TIMEOUT
[Link with onclick navigation and href navigation ] [Link with onclick navigation and href navigation ]
expected: FAIL expected: FAIL

View file

@ -1,13 +1,12 @@
[failure-check-sequence.https.html] [failure-check-sequence.https.html]
expected: TIMEOUT
[CSP check precedes COEP check - CSP header first] [CSP check precedes COEP check - CSP header first]
expected: TIMEOUT expected: FAIL
[COEP check precedes X-Frame-Options check] [COEP check precedes X-Frame-Options check]
expected: NOTRUN expected: FAIL
[CSP check precedes COEP check - COEP header first] [CSP check precedes COEP check - COEP header first]
expected: NOTRUN expected: FAIL
[CSP check precedes X-Frame-Options check] [CSP check precedes X-Frame-Options check]
expected: FAIL expected: FAIL

View file

@ -4,7 +4,7 @@
expected: FAIL expected: FAIL
[Navigating to a different document with form submission] [Navigating to a different document with form submission]
expected: NOTRUN expected: TIMEOUT
[Navigating to a different document with link click] [Navigating to a different document with link click]
expected: TIMEOUT expected: FAIL

View file

@ -1,4 +0,0 @@
[javascript-url-load-as-html.xhtml]
expected: TIMEOUT
[javascript: URL navigation to a string must create a HTML document using the correct properties]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[traverse-during-unload.html]
expected: TIMEOUT
[Traversing the history during unload]
expected: TIMEOUT

View file

@ -0,0 +1,3 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,2 +0,0 @@
[2d.layer.alpha.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[imagesmoothing.html]
[Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern().]
expected: FAIL

View file

@ -1,2 +0,0 @@
[layers-alpha-filter.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[layers-filter.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[layers-globalcompositeoperation.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[2d.layer.alpha.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[2d.layer.alpha.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.alpha.filter.globalcompositeoperation.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.alpha.filter.shadow.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.alpha.filter.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.alpha.shadow.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.alpha.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.filter.globalcompositeoperation.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.filter.shadow.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.filter.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.globalcompositeoperation.w.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[2d.layer.global-states.shadow.w.html]
expected: TIMEOUT

View file

@ -1,5 +1,3 @@
[spin-by-blocking-style-sheet.html] [spin-by-blocking-style-sheet.html]
expected: TIMEOUT
[Script-blocking style sheet should pause flushing autofocus candidates.] [Script-blocking style sheet should pause flushing autofocus candidates.]
expected: TIMEOUT expected: FAIL

View file

@ -1,5 +1,4 @@
[supported-elements.html] [supported-elements.html]
expected: TIMEOUT
[Contenteditable element should support autofocus] [Contenteditable element should support autofocus]
expected: FAIL expected: FAIL
@ -10,7 +9,7 @@
expected: FAIL expected: FAIL
[Area element should support autofocus] [Area element should support autofocus]
expected: TIMEOUT expected: FAIL
[Host element with delegatesFocus should support autofocus] [Host element with delegatesFocus should support autofocus]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,4 @@
[iframe_sandbox_popups_escaping-1.html] [iframe_sandbox_popups_escaping-1.html]
type: testharness type: testharness
expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: FAIL expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-1.html] [iframe_sandbox_popups_nonescaping-1.html]
type: testharness type: testharness
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: FAIL

View file

@ -175,3 +175,6 @@
[application/x-www-form-urlencoded: single quote in name (normal form)] [application/x-www-form-urlencoded: single quote in name (normal form)]
expected: FAIL expected: FAIL
[application/x-www-form-urlencoded: 0x00 in filename (formdata event)]
expected: FAIL

View file

@ -0,0 +1,3 @@
[historical.html]
[<input name=isindex> should not be supported]
expected: FAIL

View file

@ -1,12 +0,0 @@
[select-event.html]
[textarea: selectionEnd disconnected node]
expected: FAIL
[input type text: selectionStart disconnected node]
expected: FAIL
[input type text: selectionStart event queue]
expected: FAIL
[input type text: setSelectionRange() event queue]
expected: FAIL

View file

@ -1,5 +1,4 @@
[import-meta-url.html] [import-meta-url.html]
expected: ERROR
[import.meta.url at top-level module DedicatedWorker] [import.meta.url at top-level module DedicatedWorker]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,3 @@
[module-delayed.html]
[async document.write in a module]
expected: FAIL

View file

@ -1,3 +0,0 @@
[module-tla-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -3,3 +3,6 @@
expected: TIMEOUT expected: TIMEOUT
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: FAIL

View file

@ -1,9 +1,10 @@
[promise-job-entry-different-function-realm.html] [promise-job-entry-different-function-realm.html]
expected: TIMEOUT
[Fulfillment handler on fulfilled promise] [Fulfillment handler on fulfilled promise]
expected: FAIL expected: FAIL
[Rejection handler on pending-then-rejected promise] [Rejection handler on pending-then-rejected promise]
expected: FAIL expected: TIMEOUT
[Thenable resolution] [Thenable resolution]
expected: FAIL expected: FAIL
@ -12,4 +13,4 @@
expected: FAIL expected: FAIL
[Fulfillment handler on pending-then-fulfilled promise] [Fulfillment handler on pending-then-fulfilled promise]
expected: FAIL expected: TIMEOUT

View file

@ -1,4 +1,16 @@
[basic.tentative.any.worker.html] [basic.tentative.any.worker.html]
[Wasm function throws argument]
expected: FAIL
[Wasm function throws null]
expected: FAIL
[Wasm function throws integer]
expected: FAIL
[Imported JS function throws]
expected: FAIL
[basic.tentative.any.sharedworker.html] [basic.tentative.any.sharedworker.html]
expected: ERROR expected: ERROR
@ -7,3 +19,14 @@
expected: ERROR expected: ERROR
[basic.tentative.any.html] [basic.tentative.any.html]
[Wasm function throws argument]
expected: FAIL
[Wasm function throws null]
expected: FAIL
[Wasm function throws integer]
expected: FAIL
[Imported JS function throws]
expected: FAIL

View file

@ -0,0 +1,8 @@
[getArg.tentative.any.worker.html]
[Getting out-of-range argument]
expected: FAIL
[getArg.tentative.any.html]
[Getting out-of-range argument]
expected: FAIL

View file

@ -1,5 +1,5 @@
[cross-partition.https.tentative.html] [cross-partition.https.tentative.html]
expected: CRASH expected: TIMEOUT
[BroadcastChannel messages aren't received from a cross-partition iframe] [BroadcastChannel messages aren't received from a cross-partition iframe]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[Worker-constructor.html]
expected: ERROR

View file

@ -64,7 +64,7 @@ function run_test(algorithmNames, slowTest) {
.then(function(result) { .then(function(result) {
if (resultType === "CryptoKeyPair") { if (resultType === "CryptoKeyPair") {
assert_goodCryptoKey(result.privateKey, algorithm, extractable, usages, "private"); assert_goodCryptoKey(result.privateKey, algorithm, extractable, usages, "private");
assert_goodCryptoKey(result.publicKey, algorithm, extractable, usages, "public"); assert_goodCryptoKey(result.publicKey, algorithm, true, usages, "public");
} else { } else {
assert_goodCryptoKey(result, algorithm, extractable, usages, "secret"); assert_goodCryptoKey(result, algorithm, extractable, usages, "secret");
} }

View file

@ -1,5 +1,6 @@
// META: title=WebCryptoAPI: importKey() for EC keys // META: title=WebCryptoAPI: importKey() for EC keys
// META: timeout=long // META: timeout=long
// META: script=../util/helpers.js
// Test importKey and exportKey for EC algorithms. Only "happy paths" are // Test importKey and exportKey for EC algorithms. Only "happy paths" are
// currently tested - those where the operation should succeed. // currently tested - those where the operation should succeed.
@ -110,6 +111,7 @@
return subtle.importKey(format, keyData, algorithm, extractable, usages). return subtle.importKey(format, keyData, algorithm, extractable, usages).
then(function(key) { then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData.d)) ? 'private' : 'public');
if (!extractable) { if (!extractable) {
return; return;
} }

View file

@ -1,5 +1,6 @@
// META: title=WebCryptoAPI: importKey() for OKP keys // META: title=WebCryptoAPI: importKey() for OKP keys
// META: timeout=long // META: timeout=long
// META: script=../util/helpers.js
// Test importKey and exportKey for OKP algorithms. Only "happy paths" are // Test importKey and exportKey for OKP algorithms. Only "happy paths" are
// currently tested - those where the operation should succeed. // currently tested - those where the operation should succeed.
@ -104,6 +105,7 @@
return subtle.importKey(format, keyData[format], algorithm, extractable, usages). return subtle.importKey(format, keyData[format], algorithm, extractable, usages).
then(function(key) { then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData[format].d)) ? 'private' : 'public');
if (!extractable) { if (!extractable) {
return; return;
} }

View file

@ -1,5 +1,6 @@
// META: title=WebCryptoAPI: importKey() for RSA keys // META: title=WebCryptoAPI: importKey() for RSA keys
// META: timeout=long // META: timeout=long
// META: script=../util/helpers.js
// Test importKey and exportKey for RSA algorithms. Only "happy paths" are // Test importKey and exportKey for RSA algorithms. Only "happy paths" are
// currently tested - those where the operation should succeed. // currently tested - those where the operation should succeed.
@ -113,6 +114,7 @@
return subtle.importKey(format, keyData[format], algorithm, extractable, usages). return subtle.importKey(format, keyData[format], algorithm, extractable, usages).
then(function(key) { then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData[format].d)) ? 'private' : 'public');
if (!extractable) { if (!extractable) {
return; return;
} }

View file

@ -1,5 +1,6 @@
// META: title=WebCryptoAPI: importKey() for symmetric keys // META: title=WebCryptoAPI: importKey() for symmetric keys
// META: timeout=long // META: timeout=long
// META: script=../util/helpers.js
// Test importKey and exportKey for non-PKC algorithms. Only "happy paths" are // Test importKey and exportKey for non-PKC algorithms. Only "happy paths" are
// currently tested - those where the operation should succeed. // currently tested - those where the operation should succeed.
@ -57,6 +58,10 @@
}); });
}); });
function hasLength(algorithm) {
return algorithm.name === 'HMAC' || algorithm.name.startsWith('AES');
}
// Test importKey with a given key format and other parameters. If // Test importKey with a given key format and other parameters. If
// extrable is true, export the key and verify that it matches the input. // extrable is true, export the key and verify that it matches the input.
function testFormat(format, algorithm, keyData, keySize, usages, extractable) { function testFormat(format, algorithm, keyData, keySize, usages, extractable) {
@ -64,6 +69,7 @@
return subtle.importKey(format, keyData, algorithm, extractable, usages). return subtle.importKey(format, keyData, algorithm, extractable, usages).
then(function(key) { then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, hasLength(key.algorithm) ? { length: keySize, ...algorithm } : algorithm, extractable, usages, 'secret');
if (!extractable) { if (!extractable) {
return; return;
} }

View file

@ -19,7 +19,7 @@ var registeredAlgorithmNames = [
"SHA-256", "SHA-256",
"SHA-384", "SHA-384",
"SHA-512", "SHA-512",
"HKDF-CTR", "HKDF",
"PBKDF2", "PBKDF2",
"Ed25519", "Ed25519",
"Ed448", "Ed448",
@ -104,9 +104,6 @@ function assert_goodCryptoKey(key, algorithm, extractable, usages, kind) {
assert_equals(key.constructor, CryptoKey, "Is a CryptoKey"); assert_equals(key.constructor, CryptoKey, "Is a CryptoKey");
assert_equals(key.type, kind, "Is a " + kind + " key"); assert_equals(key.type, kind, "Is a " + kind + " key");
if (key.type === "public") {
extractable = true; // public keys are always extractable
}
assert_equals(key.extractable, extractable, "Extractability is correct"); assert_equals(key.extractable, extractable, "Extractability is correct");
assert_equals(key.algorithm.name, registeredAlgorithmName, "Correct algorithm name"); assert_equals(key.algorithm.name, registeredAlgorithmName, "Correct algorithm name");
@ -130,6 +127,10 @@ function assert_goodCryptoKey(key, algorithm, extractable, usages, kind) {
assert_equals(key.algorithm.hash.name.toUpperCase(), algorithm.hash.toUpperCase(), "Correct hash function"); assert_equals(key.algorithm.hash.name.toUpperCase(), algorithm.hash.toUpperCase(), "Correct hash function");
} }
if (/^(?:Ed|X)(?:25519|448)$/.test(key.algorithm.name)) {
assert_false('namedCurve' in key.algorithm, "Does not have a namedCurve property");
}
// usages is expected to be provided for a key pair, but we are checking // usages is expected to be provided for a key pair, but we are checking
// only a single key. The publicKey and privateKey portions of a key pair // only a single key. The publicKey and privateKey portions of a key pair
// recognize only some of the usages appropriate for a key pair. // recognize only some of the usages appropriate for a key pair.

View file

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="fuzzy" content="maxDifference=0-1; totalPixels=0-2500" />
<title>CSS Animations Test: pauses a opacity animation and sets the current time</title> <title>CSS Animations Test: pauses a opacity animation and sets the current time</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-name"> <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-name">

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/utils.js"></script>
<div id="target"></div>
<script>
transition_test({
syntax: "<length>",
from: "100px",
to: "200px",
expected: "150px",
transitionProperty: "all"
}, 'A custom property can yield a CSS Transition with transition-property: all');
</script>

View file

@ -183,6 +183,8 @@ function transition_test(options, description) {
promise_test(async () => { promise_test(async () => {
const customProperty = generate_name(); const customProperty = generate_name();
options.transitionProperty ??= customProperty;
CSS.registerProperty({ CSS.registerProperty({
name: customProperty, name: customProperty,
syntax: options.syntax, syntax: options.syntax,
@ -199,7 +201,7 @@ function transition_test(options, description) {
}); });
}); });
target.style.transition = `${customProperty} 1s -500ms linear`; target.style.transition = `${options.transitionProperty} 1s -500ms linear`;
target.style.setProperty(customProperty, options.to); target.style.setProperty(customProperty, options.to);
const animations = target.getAnimations(); const animations = target.getAnimations();

View file

@ -59,5 +59,5 @@ function runTest() {
}); });
} }
onload = requestAnimationFrame(() => requestAnimationFrame(runTest)); onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>

View file

@ -60,5 +60,5 @@ function runTest() {
}); });
} }
onload = requestAnimationFrame(() => requestAnimationFrame(runTest)); onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>

View file

@ -33,7 +33,7 @@
height: 300px; height: 300px;
} }
html::view-transition-container(root) { animation-duration: 300s; } html::view-transition-group(root) { animation-duration: 300s; }
html::view-transition-old(target) { html::view-transition-old(target) {
animation: unset; animation: unset;
opacity: 1; opacity: 1;

View file

@ -51,5 +51,5 @@ function runTest() {
}); });
} }
onload = requestAnimationFrame(() => requestAnimationFrame(runTest)); onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>

View file

@ -53,5 +53,5 @@ function runTest() {
}); });
} }
onload = requestAnimationFrame(() => requestAnimationFrame(runTest)); onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>

View file

@ -26,7 +26,7 @@ body { margin : 0; }
filter: blur(30px); filter: blur(30px);
} }
html::view-transition-container(root) { animation-duration: 300s; } html::view-transition-group(root) { animation-duration: 300s; }
html::view-transition-old(target) { html::view-transition-old(target) {
animation: unset; animation: unset;
opacity: 1; opacity: 1;
@ -48,5 +48,5 @@ async function runTest() {
}); });
transition.ready.then(() => requestAnimationFrame(takeScreenshot)); transition.ready.then(() => requestAnimationFrame(takeScreenshot));
} }
onclick = requestAnimationFrame(() => requestAnimationFrame(runTest)); onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>

View file

@ -3,7 +3,7 @@
<title>View transitions: capture span elements</title> <title>View transitions: capture span elements</title>
<link rel="help" href="https://github.com/WICG/view-transitions"> <link rel="help" href="https://github.com/WICG/view-transitions">
<link rel="author" href="mailto:vmpstr@chromium.org"> <link rel="author" href="mailto:vmpstr@chromium.org">
<link rel="match" href="new-content-captures-positioned-spans-ref.html"> <link rel="match" href="new-content-captures-spans-ref.html">
<script src="/common/reftest-wait.js"></script> <script src="/common/reftest-wait.js"></script>
<style> <style>
span { span {

View file

@ -0,0 +1,75 @@
<!DOCTYPE html>
<title>View transitions: New content is an inline element (ref)</title>
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">
<style>
:root { background-color: rebeccapurple; }
body { margin: 0; }
.container {
position: absolute;
left: 100px;
width: 400px;
height: 100px;
background-color: grey;
}
.container.start {
top: 100px;
}
.container.end {
top: 300px;
}
.container.transitioned {
left: 20px;
width: 200px;
transform: translateY(-50px);
}
.inline {
opacity: 0;
background-color: coral;
color: rgba(0, 0, 0, 0);
}
.transitioned .inline {
opacity: 1;
}
#dummyStartInline {
position: absolute;
left: 100px;
top: 100px;
width: 200px;
/* scale transform applied in script below */
transform-origin: top left;
}
</style>
<div class="container start">
<span>FILLER FILLER</span>
<span id="start" class="inline">INLINE INLINE INLINE INLINE</span>
<p style="margin-top: 50px">START STATE</p>
</div>
<div class="container end transitioned">
<span>FILLER FILLER</span>
<span id="end" class="inline">INLINE INLINE INLINE INLINE</span>
<p>END STATE</p>
</div>
<div id="dummyStartInline" class="transitioned">
<span style="opacity:0">FILLER FILLER</span>
<span class="inline">INLINE INLINE INLINE INLINE</span>
</div>
<script>
let endWidth = document.getElementById('end').getBoundingClientRect().width;
let startWidth = document.getElementById('start').getBoundingClientRect().width;
let scale = startWidth / endWidth;
document.getElementById('dummyStartInline').style.transform = `scale(${scale})`;
</script>

View file

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html class=reftest-wait>
<title>View transitions: New content is an inline element.</title>
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">
<link rel="match" href="new-content-is-inline-ref.html">
<meta name="fuzzy" content="new-content-is-inline-ref.html:0-255;0-1000">
<script src="/common/reftest-wait.js"></script>
<style>
body { margin : 0; }
.container {
position: absolute;
left: 100px;
width: 400px;
height: 100px;
background-color: grey;
}
.container.start {
top: 100px;
view-transition-name: container-start;
}
.container.end {
top: 300px;
view-transition-name: container-end;
}
.transitioned .container {
left: 20px;
width: 200px;
transform: translateY(-50px);
}
.inline {
background-color: limegreen;
/* allow small pixel diff in text */
color: rgba(0, 0, 0, 0);
}
.start .inline {
view-transition-name: start;
}
.end .inline {
view-transition-name: end;
}
.transitioned .inline {
background-color: coral;
}
/* Overlay the page with purple to ensure screenshots taken are of the view
* transition. */
:root {
view-transition-name: none;
}
::view-transition {
background-color: rebeccapurple;
}
/* This step function keeps the old snapshots in their initial state for half
* the duration, then the new snapshots in their final state for the last half
* of the duration. */
html::view-transition-group(*),
html::view-transition-new(*),
html::view-transition-old(*) {
animation-timing-function: steps(2, jump-none);
}
/* Set different durations for start and end so the two subtrees can be
* differentiated. The test will manually control animation playback so
* duration doesn't matter. */
html::view-transition-group(container-start),
html::view-transition-group(start),
html::view-transition-new(container-start),
html::view-transition-old(container-start) {
animation-duration: 2s;
}
html::view-transition-group(container-end),
html::view-transition-group(end),
html::view-transition-new(container-end),
html::view-transition-old(container-end) {
animation-duration: 3s;
}
/* Hide the old states for the inlines, they're tested in
* old-content-is-inline.html */
html::view-transition-old(start),
html::view-transition-old(end) {
animation: unset;
opacity: 0;
}
html::view-transition-new(start),
html::view-transition-new(end) {
animation: unset;
opacity: 1;
}
</style>
<!--
This subtree will be held at the animation start to test the old content's
starting position.
-->
<div class="container start">
<span>FILLER FILLER</span>
<span id="start" class="inline">INLINE INLINE INLINE INLINE</span>
<p style="margin-top: 50px">START STATE</p>
</div>
<!--
This subtree will be held at the animation end to test the old content's
ending position.
-->
<div class="container end">
<span>FILLER FILLER</span>
<span id="end" class="inline">INLINE INLINE INLINE INLINE</span>
<p>END STATE</p>
</div>
<script>
if (typeof failIfNot != 'undefined')
failIfNot(document.startViewTransition, "Missing document.startViewTransition");
async function runTest() {
let transition = document.startViewTransition(() => {
document.body.classList.add('transitioned');
});
transition.ready.then(() => {
for (const anim of document.getAnimations()) {
anim.pause();
if (anim.effect.getTiming().duration == 3000) {
// This is an animation for the end subtree. Adjust it to the end
// (without finishing the animation) so we're displaying the final
// position.
anim.currentTime = anim.effect.getTiming().duration - 1;
}
}
requestAnimationFrame(takeScreenshot);
});
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<title>View transitions: Old content is an inline element (ref)</title>
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">
<style>
:root { background-color: rebeccapurple; }
body { margin: 0; }
.container {
position: absolute;
left: 100px;
width: 400px;
height: 100px;
background-color: grey;
}
.container.start {
top: 100px;
}
.container.end {
top: 300px;
}
.container.transitioned {
left: 20px;
width: 200px;
transform: translateY(-50px);
}
.inline {
background-color: limegreen;
color: rgba(0, 0, 0, 0);
}
.transitioned .inline {
opacity: 0;
}
#dummyEndInline {
position: absolute;
left: 20px;
top: 250px;
/* scale transform applied in script below */
transform-origin: top left;
}
</style>
<div class="container start">
<span>FILLER FILLER</span>
<span id="start" class="inline">INLINE INLINE INLINE INLINE</span>
<p>START STATE</p>
</div>
<div class="container end transitioned">
<span>FILLER FILLER</span>
<span id="end" class="inline">INLINE INLINE INLINE INLINE</span>
<p>END STATE</p>
</div>
<div id="dummyEndInline">
<span style="opacity:0">FILLER FILLER</span>
<span class="inline">INLINE INLINE INLINE INLINE</span>
</div>
<script>
let endWidth = document.getElementById('end').getBoundingClientRect().width;
let startWidth = document.getElementById('start').getBoundingClientRect().width;
let scale = endWidth / startWidth;
document.getElementById('dummyEndInline').style.transform = `scale(${scale})`;
</script>

View file

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html class=reftest-wait>
<title>View transitions: Old content is an inline element.</title>
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">
<link rel="match" href="old-content-is-inline-ref.html">
<meta name="fuzzy" content="old-content-is-inline-ref.html:0-255;0-500">
<script src="/common/reftest-wait.js"></script>
<style>
body { margin : 0; }
.container {
position: absolute;
left: 100px;
width: 400px;
height: 100px;
background-color: grey;
}
.container.start {
top: 100px;
view-transition-name: container-start;
}
.container.end {
top: 300px;
view-transition-name: container-end;
}
.transitioned .container {
left: 20px;
width: 200px;
transform: translateY(-50px);
}
.inline {
background-color: limegreen;
/* allow small pixel diff in text */
color: rgba(0, 0, 0, 0);
}
.start .inline {
view-transition-name: start;
}
.end .inline {
view-transition-name: end;
}
.transitioned .inline {
background-color: coral;
}
/* Overlay the page with purple to ensure screenshots taken are of the view
* transition. */
:root {
view-transition-name: none;
}
::view-transition {
background-color: rebeccapurple;
}
/* This step function keeps the old snapshots in their initial state for half
* the duration, then the new snapshots in their final state for the last half
* of the duration. */
html::view-transition-group(*),
html::view-transition-new(*),
html::view-transition-old(*) {
animation-timing-function: steps(2, jump-none);
}
/* Set different durations for start and end so the two subtrees can be
* differentiated. The test will manually control animation playback so
* duration doesn't matter. */
html::view-transition-group(container-start),
html::view-transition-group(start),
html::view-transition-new(container-start),
html::view-transition-old(container-start) {
animation-duration: 2s;
}
html::view-transition-group(container-end),
html::view-transition-group(end),
html::view-transition-new(container-end),
html::view-transition-old(container-end) {
animation-duration: 3s;
}
/* Hide the new states for the inlines, they're tested in
* new-content-is-inline.html */
html::view-transition-new(start),
html::view-transition-new(end) {
animation: unset;
opacity: 0;
}
html::view-transition-old(start),
html::view-transition-old(end) {
animation: unset;
opacity: 1;
}
</style>
<!--
This subtree will be held at the animation start to test the old content's
starting position.
-->
<div class="container start">
<span>FILLER FILLER</span>
<span id="start" class="inline">INLINE INLINE INLINE INLINE</span>
<p>START STATE</p>
</div>
<!--
This subtree will be held at the animation end to test the old content's
ending position.
-->
<div class="container end">
<span>FILLER FILLER</span>
<span id="end" class="inline">INLINE INLINE INLINE INLINE</span>
<p>END STATE</p>
</div>
<script>
if (typeof failIfNot != 'undefined')
failIfNot(document.startViewTransition, "Missing document.startViewTransition");
async function runTest() {
let transition = document.startViewTransition(() => {
document.body.classList.add('transitioned');
});
transition.ready.then(() => {
for (const anim of document.getAnimations()) {
anim.pause();
if (anim.effect.getTiming().duration == 3000) {
// This is an animation for the end subtree. Adjust it to the end
// (without finishing the animation) so we're displaying the final
// position.
anim.currentTime = anim.effect.getTiming().duration - 1;
}
}
requestAnimationFrame(takeScreenshot);
});
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>

View file

@ -61,7 +61,7 @@ async function runTest() {
}); });
} }
onload = requestAnimationFrame(runTest); onload = () => requestAnimationFrame(runTest);
</script> </script>
</html> </html>

View file

@ -66,7 +66,7 @@ async function runTest() {
}); });
} }
onload = requestAnimationFrame(runTest); onload = () => requestAnimationFrame(runTest);
</script> </script>
</html> </html>

View file

@ -30,7 +30,7 @@
top: 200px; top: 200px;
} }
html::view-transition-container(root) { animation-duration: 300s; } html::view-transition-group(root) { animation-duration: 300s; }
html::view-transition-old(target) { html::view-transition-old(target) {
animation: unset; animation: unset;
opacity: 1; opacity: 1;

View file

@ -28,7 +28,7 @@
background: green; background: green;
} }
html::view-transition-container(root) { animation-duration: 300s; } html::view-transition-group(root) { animation-duration: 300s; }
html::view-transition-old(target) { html::view-transition-old(target) {
animation: unset; animation: unset;
opacity: 1; opacity: 1;

View file

@ -23,7 +23,7 @@
background: green; background: green;
} }
html::view-transition-container(root) { animation-duration: 300s; } html::view-transition-group(root) { animation-duration: 300s; }
html::view-transition-old(target) { html::view-transition-old(target) {
animation: unset; animation: unset;
opacity: 1; opacity: 1;

View file

@ -20,6 +20,6 @@ function run() {
})); }));
}); });
} }
onload = requestAnimationFrame(() => requestAnimationFrame(run)); onload = () => requestAnimationFrame(() => requestAnimationFrame(run));
</script> </script>

View file

@ -516,6 +516,24 @@ complex cleanup behavior should manage execution order explicitly. If
any of the eventual values are rejected, the test runner will report any of the eventual values are rejected, the test runner will report
an error. an error.
### AbortSignal support ###
[`Test.get_signal`](#Test.get_signal) gives an AbortSignal that is aborted when
the test finishes. This can be useful when dealing with AbortSignal-supported
APIs.
```js
promise_test(t => {
// Throws when the user agent does not support AbortSignal
const signal = t.get_signal();
const event = await new Promise(resolve => {
document.body.addEventListener(resolve, { once: true, signal });
document.body.click();
});
assert_equals(event.type, "click");
}, "");
```
## Timers in Tests ## ## Timers in Tests ##
In general the use of timers (i.e. `setTimeout`) in tests is In general the use of timers (i.e. `setTimeout`) in tests is

View file

@ -0,0 +1,33 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
document.addEventListener("DOMContentLoaded", () => {
document.execCommand("selectAll");
const editingHost = document.querySelector("thead[contenteditable]");
editingHost.addEventListener("focus", () => {
editingHost.addEventListener("focusout", () => {
document.execCommand("italic");
document.execCommand("insertText", false, "A");
document.execCommand("insertUnorderedList");
});
document.designMode = "on";
document.execCommand("selectAll");
document.execCommand("insertHTML", false, "A");
});
editingHost.focus();
});
</script>
</head>
<body>
<big>
</big>
<table>
<thead contenteditable>
</thead></table>
<p>
<object></object>
</p>
</body>
</html>

View file

@ -3012,4 +3012,11 @@ var browserTests = [
"<ol>\n<li>{}<br></li></ol>"], "<ol>\n<li>{}<br></li></ol>"],
[true], [true],
{}], {}],
// Select all list item children when list items have multiple nodes.
["{<ul><li>abc<span>def</span>ghi</li><li>jkl<span>opq</span>rst</li></ul>}",
[["delete",""]],
"<ul><li>{}<br></li></ul>",
[true],
{}],
] ]

View file

@ -2892,4 +2892,11 @@ var browserTests = [
"<ol>\n<li>{}<br></li></ol>"], "<ol>\n<li>{}<br></li></ol>"],
[true], [true],
{}], {}],
// Select all list item children when list items have multiple nodes.
["{<ul><li>abc<span>def</span>ghi</li><li>jkl<span>opq</span>rst</li></ul>}",
[["delete",""]],
"<ul><li>{}<br></li></ul>",
[true],
{}],
] ]

View file

@ -96,7 +96,14 @@ class EditorTestUtils {
// - `{` specifies start boundary before a node // - `{` specifies start boundary before a node
// - `]` specifies end boundary in a text node // - `]` specifies end boundary in a text node
// - `}` specifies end boundary after a node // - `}` specifies end boundary after a node
setupEditingHost(innerHTMLWithRangeMarkers) { //
// options can have following fields:
// - selection: how to set selection, "addRange" (default),
// "setBaseAndExtent", "setBaseAndExtent-reverse".
setupEditingHost(innerHTMLWithRangeMarkers, options = {}) {
if (!options.selection) {
options.selection = "addRange";
}
const startBoundaries = innerHTMLWithRangeMarkers.match(/\{|\[/g) || []; const startBoundaries = innerHTMLWithRangeMarkers.match(/\{|\[/g) || [];
const endBoundaries = innerHTMLWithRangeMarkers.match(/\}|\]/g) || []; const endBoundaries = innerHTMLWithRangeMarkers.match(/\}|\]/g) || [];
if (startBoundaries.length !== endBoundaries.length) { if (startBoundaries.length !== endBoundaries.length) {
@ -351,9 +358,31 @@ class EditorTestUtils {
ranges.push(range); ranges.push(range);
} }
if (options.selection != "addRange" && ranges.length > 1) {
throw `Failed due to invalid selection option, ${options.selection}, for multiple selection ranges`;
}
this.selection.removeAllRanges(); this.selection.removeAllRanges();
for (let range of ranges) { for (const range of ranges) {
this.selection.addRange(range); if (options.selection == "addRange") {
this.selection.addRange(range);
} else if (options.selection == "setBaseAndExtent") {
this.selection.setBaseAndExtent(
range.startContainer,
range.startOffset,
range.endContainer,
range.endOffset
);
} else if (options.selection == "setBaseAndExtent-reverse") {
this.selection.setBaseAndExtent(
range.endContainer,
range.endOffset,
range.startContainer,
range.startOffset
);
} else {
throw `Failed due to invalid selection option, ${options.selection}`;
}
} }
if (this.selection.rangeCount != ranges.length) { if (this.selection.rangeCount != ranges.length) {

View file

@ -364,31 +364,43 @@ function runGenericSensorTests(sensorName,
sensor.stop(); sensor.stop();
}, `${sensorName}: Test that fresh reading is fetched on start().`); }, `${sensorName}: Test that fresh reading is fetched on start().`);
// TBD file a WPT issue: visibilityChangeWatcher times out. sensor_test(async (t, sensorProvider) => {
// sensor_test(async (t, sensorProvider) => { assert_implements(sensorName in self, `${sensorName} is not supported.`);
// assert_implements(sensorName in self, `${sensorName} is not supported.`); const sensor = new sensorType();
// const sensor = new sensorType(); t.add_cleanup(() => {
// const sensorWatcher = new EventWatcher(t, sensor, ["reading", "error"]); sensor.stop();
// const visibilityChangeWatcher = new EventWatcher(t, document, });
// "visibilitychange"); const sensorWatcher = new EventWatcher(t, sensor, ['reading', 'error']);
// sensor.start(); sensor.start();
// const mockSensor = await sensorProvider.getCreatedSensor(sensorName); const mockSensor = await sensorProvider.getCreatedSensor(sensorName);
// mockSensor.setSensorReading(readings); mockSensor.setSensorReading(readings);
// await sensorWatcher.wait_for("reading"); const expectedBuffer = new RingBuffer(expectedReadings);
// const expected = new RingBuffer(expectedReadings).next().value; await sensorWatcher.wait_for('reading');
// assert_true(verificationFunction(expected, sensor)); const expected1 = expectedBuffer.next().value;
// const cachedTimestamp1 = sensor.timestamp; assert_true(verificationFunction(expected1, sensor));
assert_true(mockSensor.isReadingData());
const cachedTimestamp1 = sensor.timestamp;
// const win = window.open('', '_blank'); const {minimize, restore} = window_state_context(t);
// await visibilityChangeWatcher.wait_for("visibilitychange");
// const cachedTimestamp2 = sensor.timestamp;
// win.close(); await minimize();
// sensor.stop(); assert_true(document.hidden);
// assert_equals(cachedTimestamp1, cachedTimestamp2); await t.step_wait(
// }, `${sensorName}: sensor readings can not be fired on the background tab.`); () => !mockSensor.isReadingData(), 'readings must be suspended');
const cachedTimestamp2 = sensor.timestamp;
assert_equals(cachedTimestamp1, cachedTimestamp2);
await restore();
assert_false(document.hidden);
await t.step_wait(
() => mockSensor.isReadingData(), 'readings must be restored');
await sensorWatcher.wait_for('reading');
const expected2 = expectedBuffer.next().value;
assert_true(verificationFunction(expected2, sensor));
assert_greater_than(sensor.timestamp, cachedTimestamp2);
}, `${sensorName}: Losing visibility must cause readings to be suspended.`);
sensor_test(async (t, sensorProvider) => { sensor_test(async (t, sensorProvider) => {
assert_implements(sensorName in self, `${sensorName} is not supported.`); assert_implements(sensorName in self, `${sensorName} is not supported.`);

View file

@ -11,6 +11,7 @@
async function loadChromiumResources() { async function loadChromiumResources() {
await loadScript('/resources/testdriver.js'); await loadScript('/resources/testdriver.js');
await loadScript('/resources/testdriver-vendor.js'); await loadScript('/resources/testdriver-vendor.js');
await loadScript('/page-visibility/resources/window_state_context.js');
await import('/resources/chromium/generic_sensor_mocks.js'); await import('/resources/chromium/generic_sensor_mocks.js');
} }

View file

@ -1,8 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.layer.alpha</title> <title>Canvas test: 2d.layer.global-states.alpha</title>
<h1>2d.layer.alpha</h1> <h1>2d.layer.global-states.alpha</h1>
<p class="desc">A test to make sure shadow works with layers.</p> <p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200"> <canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p> <p class="fallback">FAIL (fallback content)</p>
</canvas> </canvas>
@ -11,7 +11,10 @@
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)'; ctx.fillStyle = 'rgba(0, 0, 255, 1)';
ctx.fillRect(50, 50, 95, 70);
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6; ctx.globalAlpha = 0.6;
@ -19,9 +22,9 @@
ctx2 = canvas2.getContext("2d"); ctx2 = canvas2.getContext("2d");
ctx2.fillStyle = 'rgba(225, 0, 0, 1)'; ctx2.fillStyle = 'rgba(225, 0, 0, 1)';
ctx2.fillRect(60, 40, 75, 50); ctx2.fillRect(50, 50, 75, 50);
ctx2.fillStyle = 'rgba(0, 255, 0, 1)'; ctx2.fillStyle = 'rgba(0, 255, 0, 1)';
ctx2.fillRect(80, 60, 75, 50); ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0); ctx.drawImage(canvas2, 0, 0);
</script> </script>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.layer.global-states.alpha.filter</title>
<h1>2d.layer.global-states.alpha.filter</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6;
ctx.filter = 'drop-shadow(-9px 9px 0px #e81)';
canvas2 = document.createElement("canvas");
ctx2 = canvas2.getContext("2d");
ctx2.fillStyle = 'rgba(225, 0, 0, 1)';
ctx2.fillRect(50, 50, 75, 50);
ctx2.fillStyle = 'rgba(0, 255, 0, 1)';
ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0);
</script>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.layer.global-states.alpha.filter.globalcompositeoperation</title>
<h1>2d.layer.global-states.alpha.filter.globalcompositeoperation</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6;
ctx.globalCompositeOperation = 'source-in';
ctx.filter = 'drop-shadow(-9px 9px 0px #e81)';
canvas2 = document.createElement("canvas");
ctx2 = canvas2.getContext("2d");
ctx2.fillStyle = 'rgba(225, 0, 0, 1)';
ctx2.fillRect(50, 50, 75, 50);
ctx2.fillStyle = 'rgba(0, 255, 0, 1)';
ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0);
</script>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<link rel="match" href="2d.layer.global-states.alpha.filter.globalcompositeoperation-expected.html">
<title>Canvas test: 2d.layer.global-states.alpha.filter.globalcompositeoperation</title>
<h1>2d.layer.global-states.alpha.filter.globalcompositeoperation</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6;
ctx.globalCompositeOperation = 'source-in';
ctx.filter = 'drop-shadow(-9px 9px 0px #e81)';
ctx.beginLayer();
ctx.fillStyle = 'rgba(225, 0, 0, 1)';
ctx.fillRect(50, 50, 75, 50);
ctx.fillStyle = 'rgba(0, 255, 0, 1)';
ctx.fillRect(70, 70, 75, 50);
ctx.endLayer();
</script>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<link rel="match" href="2d.layer.global-states.alpha.filter-expected.html">
<title>Canvas test: 2d.layer.global-states.alpha.filter</title>
<h1>2d.layer.global-states.alpha.filter</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6;
ctx.filter = 'drop-shadow(-9px 9px 0px #e81)';
ctx.beginLayer();
ctx.fillStyle = 'rgba(225, 0, 0, 1)';
ctx.fillRect(50, 50, 75, 50);
ctx.fillStyle = 'rgba(0, 255, 0, 1)';
ctx.fillRect(70, 70, 75, 50);
ctx.endLayer();
</script>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.layer.global-states.alpha.filter.shadow</title>
<h1>2d.layer.global-states.alpha.filter.shadow</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.5;
ctx.filter = 'sepia(0.5)';
ctx.shadowOffsetX = -10;
ctx.shadowOffsetY = 10;
ctx.shadowColor = 'orange';
canvas2 = document.createElement("canvas");
ctx2 = canvas2.getContext("2d");
ctx2.fillStyle = 'rgba(225, 0, 0, 1)';
ctx2.fillRect(50, 50, 75, 50);
ctx2.fillStyle = 'rgba(0, 255, 0, 1)';
ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0);
</script>

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<link rel="match" href="2d.layer.global-states.alpha.filter.shadow-expected.html">
<meta name=fuzzy content="maxDifference=0-2; totalPixels=0-5824">
<title>Canvas test: 2d.layer.global-states.alpha.filter.shadow</title>
<h1>2d.layer.global-states.alpha.filter.shadow</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.5;
ctx.filter = 'sepia(0.5)';
ctx.shadowOffsetX = -10;
ctx.shadowOffsetY = 10;
ctx.shadowColor = 'orange';
ctx.beginLayer();
ctx.fillStyle = 'rgba(225, 0, 0, 1)';
ctx.fillRect(50, 50, 75, 50);
ctx.fillStyle = 'rgba(0, 255, 0, 1)';
ctx.fillRect(70, 70, 75, 50);
ctx.endLayer();
</script>

View file

@ -1,9 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<link rel="match" href="2d.layer.alpha-expected.html"> <link rel="match" href="2d.layer.global-states.alpha-expected.html">
<title>Canvas test: 2d.layer.alpha</title> <title>Canvas test: 2d.layer.global-states.alpha</title>
<h1>2d.layer.alpha</h1> <h1>2d.layer.global-states.alpha</h1>
<p class="desc">A test to make sure shadow works with layers.</p> <p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200"> <canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p> <p class="fallback">FAIL (fallback content)</p>
</canvas> </canvas>
@ -12,16 +12,19 @@
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)'; ctx.fillStyle = 'rgba(0, 0, 255, 1)';
ctx.fillRect(50, 50, 95, 70);
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.6; ctx.globalAlpha = 0.6;
ctx.beginLayer(); ctx.beginLayer();
ctx.fillStyle = 'rgba(225, 0, 0, 1)'; ctx.fillStyle = 'rgba(225, 0, 0, 1)';
ctx.fillRect(60, 40, 75, 50); ctx.fillRect(50, 50, 75, 50);
ctx.fillStyle = 'rgba(0, 255, 0, 1)'; ctx.fillStyle = 'rgba(0, 255, 0, 1)';
ctx.fillRect(80, 60, 75, 50); ctx.fillRect(70, 70, 75, 50);
ctx.endLayer(); ctx.endLayer();
</script> </script>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.layer.global-states.alpha.shadow</title>
<h1>2d.layer.global-states.alpha.shadow</h1>
<p class="desc">Checks that layers correctly use global render states.</p>
<canvas id="canvas" width="200" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 1)';
var circle = new Path2D();
circle.arc(90, 90, 45, 0, 2 * Math.PI);
ctx.fill(circle);
ctx.globalAlpha = 0.5;
ctx.shadowOffsetX = -10;
ctx.shadowOffsetY = 10;
ctx.shadowColor = 'orange';
canvas2 = document.createElement("canvas");
ctx2 = canvas2.getContext("2d");
ctx2.fillStyle = 'rgba(225, 0, 0, 1)';
ctx2.fillRect(50, 50, 75, 50);
ctx2.fillStyle = 'rgba(0, 255, 0, 1)';
ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0);
</script>

Some files were not shown because too many files have changed in this diff Show more