Auto merge of #27693 - servo-wpt-sync:wpt_update_09-10-2020, r=servo-wpt-sync

Sync WPT with upstream (09-10-2020)

Automated downstream sync of changes from upstream as of 09-10-2020.
[no-wpt-sync]
r? @servo-wpt-sync
This commit is contained in:
bors-servo 2020-10-09 09:51:48 -04:00 committed by GitHub
commit 14fd2e56e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
123 changed files with 814 additions and 390 deletions

View file

@ -4,7 +4,7 @@
expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.]
expected: FAIL
expected: TIMEOUT
[Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL

View file

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

View file

@ -0,0 +1,2 @@
[text-underline-offset-negative.html]
expected: FAIL

View file

@ -2,6 +2,3 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -1,4 +0,0 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementFromPoint-001.html]
[CSSOM View - 5 - extensions to the Document interface]
expected: FAIL

View file

@ -17,3 +17,6 @@
[test the top of layer]
expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-invalid-cases.html]
[The root element is the last element returned for otherwise empty queries within the viewport]
expected: FAIL

View file

@ -1,2 +0,0 @@
[matchMedia-display-none-iframe.html]
expected: ERROR

View file

@ -0,0 +1,4 @@
[mq-dynamic-empty-children.html]
[Dynamic evaluation of media queries works fine in presence of empty media rule]
expected: FAIL

View file

@ -0,0 +1,2 @@
[HTMLMediaElement.html]
expected: TIMEOUT

View file

@ -312,15 +312,6 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: NOTRUN
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
@ -330,6 +321,15 @@
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL

View file

@ -53,3 +53,6 @@
[combined text/javascript ]
expected: FAIL
[separate text/javascript x/x]
expected: FAIL

View file

@ -11,6 +11,9 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
[X-Content-Type-Options%3A%20%2Cnosniff]
expected: FAIL
[Content-Type-Options%3A%20nosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[embedded-opener-remove-frame.html]
expected: CRASH
[opener of discarded nested browsing context]
expected: FAIL

View file

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

View file

@ -171,3 +171,6 @@
[XHTML img usemap="#hash-id"]
expected: FAIL
[HTML (standards) IMG usemap="no-hash-name"]
expected: FAIL

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,10 @@
[non-active-document.html]
[DOMParser]
expected: FAIL
[createHTMLDocument]
expected: FAIL
[<template>]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hidden-charset-case-sensitive.html]
[keyword _charset_]
expected: FAIL

View file

@ -0,0 +1,2 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[ignore-opens-during-unload.window.html]
expected: CRASH
expected: TIMEOUT
[document.open should bail out when ignore-opens-during-unload is greater than 0 during visibilitychange event (open(parent) while unloading parent and child)]
expected: TIMEOUT

View file

@ -176,3 +176,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -176,3 +176,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -176,3 +176,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -1,5 +1,4 @@
[realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL

View file

@ -1,4 +1,5 @@
[audiocontext-not-fully-active.html]
expected: TIMEOUT
[frame in navigated remote-site frame]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[import-in-moduleworker.html]
expected: ERROR
[Base URL in module dedicated workers: import]
expected: FAIL

View file

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

View file

@ -7,7 +7,7 @@
expected: FAIL
[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.]
expected: TIMEOUT

View file

@ -190464,6 +190464,19 @@
{}
]
],
"text-underline-offset-negative.html": [
"1c945cc40374e3a92ec517f29b119fafc9b03462",
[
null,
[
[
"/css/css-text-decor/reference/text-underline-offset-negative-notref.html",
"!="
]
],
{}
]
],
"text-underline-offset-scroll-001.html": [
"ee521fa215c7b9102ec6a6805c2866bf433c10a4",
[
@ -225313,7 +225326,7 @@
]
],
"contain-size-select-elem-005.html": [
"74379b8059198377d74489961e48738ae954c055",
"127b3cd5f87af2078b1ce8618120c37994a68e5a",
[
null,
[
@ -318295,6 +318308,10 @@
"8e8d1ff09870912f96520bea51ca467034f99ae7",
[]
],
"text-underline-offset-negative-notref.html": [
"4b0b285a797479f5cf979b778d51456507c24cb5",
[]
],
"text-underline-offset-scroll-001-notref.html": [
"c76a6a4945d0ad5324508cb372ba88fe52005fa9",
[]
@ -326546,7 +326563,7 @@
[]
],
"contain-size-select-elem-005-ref.html": [
"894631d24a0effecc9092671a7ec2dd17c008b95",
"e14152d63383171ca890b1a89a4819eab0669bd3",
[]
],
"contain-size-table-caption-001-ref.html": [
@ -346853,7 +346870,7 @@
[]
],
"http2-context.sub.h2.any.js.ini": [
"665258c9d94c2fc934b07fdb33d7e54eac6bc0cb",
"2bd49967c7cdd1bf0d6382a5bdd826365f7186e7",
[]
],
"order-of-metas.any.js.ini": [
@ -346869,7 +346886,7 @@
[]
],
"wpt-server-http.sub.html.ini": [
"b1e18f8948acf097d415209d18f084da58e02fa9",
"e2f26c7e4b697c77c5ee195cad763279bd1ecde0",
[]
],
"wpt-server-websocket.sub.html.ini": [
@ -346915,6 +346932,10 @@
"657d2a2492605557dcc62f02dca36364cf3007fd",
[]
],
"penPointerEventProperties.html.ini": [
"9a107f0f02de0adc8d45dbcd331b47f5e0a25f29",
[]
],
"wheelScroll.html.ini": [
"f96fd377ba5daee31d56df4f6d490beb01e18522",
[]
@ -347530,7 +347551,7 @@
[]
],
"presentation-api.idl": [
"0757e9b8bf203ad2f5a3ce783f1c1468464a7828",
"4f1e4bee835a23c5b7bcf54b5b05f4ded2b08023",
[]
],
"proximity.idl": [
@ -347566,7 +347587,7 @@
[]
],
"sanitizer-api.tentative.idl": [
"27e4ecf26c302610ef69ab4be8843cb59f9978d2",
"11653d1a186aa3159aaf5e44f5b0ff6ecf1dc50a",
[]
],
"savedata.idl": [
@ -347582,7 +347603,7 @@
[]
],
"screen-wake-lock.idl": [
"56bc8f43e4d08ad81f48eff802f46f7951cbe0a9",
"c9d259ebcc4e21faf497be42a169fe4b265bc9a8",
[]
],
"scroll-animations.idl": [
@ -347730,7 +347751,7 @@
[]
],
"webmidi.idl": [
"cf08897e99e8f493bc7e44d301dc7cdee75656a3",
"89847c3d4597b06c59924f64d71a2555b68359a8",
[]
],
"webrtc-identity.idl": [
@ -347750,7 +347771,7 @@
[]
],
"webrtc.idl": [
"9c438f31093d55bbf08ca29a11c0f617d37481b2",
"d82cde768f7b5f65e78570227510f2e4f0d4b7c1",
[]
],
"webusb.idl": [
@ -348005,7 +348026,7 @@
]
},
"lint.ignore": [
"8431077e6a677d6f0eeb2c05ab024fd073a5f490",
"5bcb811df36051225f60efa903f7f1e4cd7eda29",
[]
],
"loading": {
@ -356766,7 +356787,7 @@
[]
],
"helpers.js": [
"05d481f277a38719b7a691ff50c8569076625424",
"12504537f91eab42f8822226eda80513698f477d",
[]
],
"receiving-shared-worker.js": [
@ -358596,7 +358617,7 @@
]
},
"requirements_flake8.txt": [
"f97916e03e97a742c8f8f664f8c4ac24c7e1327a",
"cd7466bf1590cdc4d3e72e48b391709c76ab17d9",
[]
],
"requirements_mypy.txt": [
@ -358693,7 +358714,7 @@
[]
],
"serve.py": [
"b1b9e931317f4e99c7110b2096a0318a8f9edf4e",
"3a1c782794a32b92869e67ab07903c209558fb7a",
[]
],
"test_functional.py": [
@ -365557,7 +365578,7 @@
[]
],
"test_handlers.py": [
"7866e641e6aa2d5d98c9d674d79838235e71929d",
"8c0e020f41467ac8df2ddba52470914979ae20bf",
[]
],
"test_input_file.py": [
@ -365573,7 +365594,7 @@
[]
],
"test_response.py": [
"6e947e478d9e14e33676cbd62bbbada2f118ec7f",
"cc740bb99df9e23d5d00a7e9fa0b23d8f7ef0382",
[]
],
"test_server.py": [
@ -365640,7 +365661,7 @@
[]
],
"response.py": [
"b7bfcebd10b6af40bc1f26278cf29557381fff3d",
"1519ed78f397646559c42fa6322a8c145a14d094",
[]
],
"router.py": [
@ -365652,7 +365673,7 @@
[]
],
"server.py": [
"d6718df3f525d21ce848f75eb91d0741d857e5cb",
"d6c61965d96de90ed747f1afaea703219f9e5074",
[]
],
"sslutils": {
@ -365678,7 +365699,7 @@
[]
],
"utils.py": [
"b005b417d743f20f065c195e743d8abcfb04adfc",
"f9ed3eaebd67f3fe3bab1961ff93f4053dfc58e4",
[]
],
"wptserve.py": [
@ -366215,7 +366236,7 @@
[]
],
"urltestdata.json": [
"c7a906c82e5acc9473db6a97e7c3fbdd2a853550",
"f55a40338a30ddfbac47f84457dc89f2db628acc",
[]
]
}
@ -366614,32 +366635,6 @@
[]
],
"resources": {
"dynamic": {
"__dir__.headers": [
"cb762eff806849df46dc758ef7b98b63f27f54c9",
[]
],
"classic_script.js": [
"db69b96188d7ca20b8bb12b429aead8fcfdc7b64",
[]
],
"resource1.js": [
"7bd437364a24b6e94493c2acca939991b15cd41c",
[]
],
"resource2.js": [
"09a4ee7b704d4f6b895d898eb68ca5d8f874f17b",
[]
],
"resource3.js": [
"851168c9dac34f49b9f12a9620277c9cfc9d4c1f",
[]
],
"resource4.js": [
"ea456b8db0a411a6a5ade3c556a5e8c3e7415ef4",
[]
]
},
"dynamic1": {
"classic_script.js": [
"5fcf045906c1ab151512a3e425b7c5c6f79cee59",
@ -366685,7 +366680,7 @@
]
},
"generate-test-wbns.sh": [
"860327fe2451015ed9ca538c39cffff14bdccc19",
"64a54bca3a408c5af751a59daf8664db62ea7d28",
[]
],
"location": {
@ -366698,6 +366693,40 @@
[]
]
},
"path-restriction": {
"other": {
"resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
]
},
"resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
],
"wbn": {
"resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
],
"sub": {
"resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
]
}
},
"wbn-resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
],
"wbn1": {
"resource.js": [
"a4967d2285ae3a87b6da6e41f786cf65527184b6",
[]
]
}
},
"subresource": {
"root.js": [
"2c2a465472b9a879a6298a969e2baf717d651535",
@ -366713,24 +366742,54 @@
"21e57b9caca1183ecda6f5d4fb9ebd556abf769a",
[]
],
"dynamic": {
"__dir__.headers": [
"cb762eff806849df46dc758ef7b98b63f27f54c9",
[]
],
"classic_script.js": [
"db69b96188d7ca20b8bb12b429aead8fcfdc7b64",
[]
],
"resource1.js": [
"7bd437364a24b6e94493c2acca939991b15cd41c",
[]
],
"resource2.js": [
"09a4ee7b704d4f6b895d898eb68ca5d8f874f17b",
[]
],
"resource3.js": [
"851168c9dac34f49b9f12a9620277c9cfc9d4c1f",
[]
],
"resource4.js": [
"ea456b8db0a411a6a5ade3c556a5e8c3e7415ef4",
[]
]
},
"dynamic1-crossorigin.wbn": [
"5ebb86178e9bf5cccfa09878210c7866f9d80478",
"597b6ee90be8094535a6e0bade4c7cbb22ba61a2",
[]
],
"dynamic1.wbn": [
"9e69e1fd89834bd2d238859413fc8e09d8b6b181",
"9ba161e20558c1f34c902bfd11b2e2f872a01213",
[]
],
"dynamic2.wbn": [
"e4d04d60c2aa9050c6454ad9f88af407a844669d",
"798da2e499dd07a2e185b6b7be41e84e88c75c4b",
[]
],
"location.wbn": [
"1129cc1e92c89b5b33c86dde61bab7e66c8379bd",
"f2b1e5333bdcaf88ed8b40246caeb57c3b1be8df",
[]
],
"path-restriction.wbn": [
"e861469e122afd141bcec8d394a0d4504898208c",
[]
],
"subresource.wbn": [
"4d059e7c0b819500c437529446158d2884915c4c",
"eabd994ff8bceaf4ef52b329b4faa158c292af12",
[]
]
}
@ -389017,7 +389076,7 @@
]
],
"async-platform-specific-write-read.tentative.https.html": [
"685b5a58a809f43e7c1379055743d5536258681c",
"f8af468bff7885eeb6fca5493e85bc68b42bf615",
[
null,
{
@ -389026,7 +389085,7 @@
]
],
"async-raw-write-read.tentative.https.html": [
"e6882b344f86de62af5c31f17719a4de6f94b2bb",
"480593dcd715eacefbdaa8f7f4da305992a80c65",
[
null,
{
@ -421003,6 +421062,13 @@
{}
]
],
"mq-dynamic-empty-children.html": [
"3edda870efcaa9383c3938fa721a147a98d73eda",
[
null,
{}
]
],
"navigation-controls.tentative.html": [
"ac1087bb65b9a8fd85d924ad1ae0de797762dac5",
[
@ -475204,7 +475270,7 @@
]
],
"hidden-charset-case-sensitive.html": [
"a6df6bcb6d7861e68426f5f0c78c9975f5d8a99c",
"537500c91f1391ac99b30d23664fd6ea3288c0b2",
[
null,
{}
@ -484704,6 +484770,15 @@
}
]
],
"penPointerEventProperties.html": [
"c5a2b1c06d902d54f63b329ef3f5253b5d72ff04",
[
null,
{
"testdriver": true
}
]
],
"wheelScroll.html": [
"a7d9b2609da763dbfaacab253edb13ca35c16627",
[
@ -510213,26 +510288,19 @@
{}
]
],
"wakelock-type.https.any.js": [
"3a1d8c465c7020594affe0cb81c67ea36839b640",
"wakelock-type.https.window.js": [
"67e935be8e1d20940827c814bdfdf8b879841b5a",
[
"screen-wake-lock/wakelock-type.https.any.html",
"screen-wake-lock/wakelock-type.https.window.html",
{
"script_metadata": [
[
"title",
"navigator.wakeLock.request() with invalid type"
]
]
}
"script",
"/resources/testdriver.js"
],
[
"screen-wake-lock/wakelock-type.https.any.worker.html",
{
"script_metadata": [
[
"title",
"navigator.wakeLock.request() with invalid type"
"script",
"/resources/testdriver-vendor.js"
]
]
}
@ -530630,7 +530698,14 @@
]
],
"subresource-loading-from-web-bundle.tentative.html": [
"574a25b681651affd6744c45370554a118befe16",
"c2de0eb0994f54c65a342b501aa3e9107949faf7",
[
null,
{}
]
],
"subresource-loading-path-restriction.tentative.html": [
"706bfb97b1142833380024c3f969b1b3b2756ec1",
[
null,
{}

View file

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

View file

@ -0,0 +1,2 @@
[text-underline-offset-negative.html]
expected: FAIL

View file

@ -2,6 +2,3 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -1,4 +0,0 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementFromPoint-001.html]
[CSSOM View - 5 - extensions to the Document interface]
expected: FAIL

View file

@ -21,3 +21,6 @@
[test the top of layer]
expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-invalid-cases.html]
[The root element is the last element returned for otherwise empty queries within the viewport]
expected: FAIL

View file

@ -1,2 +0,0 @@
[matchMedia-display-none-iframe.html]
expected: ERROR

View file

@ -0,0 +1,4 @@
[mq-dynamic-empty-children.html]
[Dynamic evaluation of media queries works fine in presence of empty media rule]
expected: FAIL

View file

@ -0,0 +1,2 @@
[HTMLMediaElement.html]
expected: TIMEOUT

View file

@ -312,15 +312,6 @@
[fetch(): separate response Content-Type: text/plain ]
expected: NOTRUN
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
@ -330,6 +321,15 @@
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL

View file

@ -53,3 +53,6 @@
[combined text/javascript ]
expected: FAIL
[separate text/javascript x/x]
expected: FAIL

View file

@ -11,6 +11,9 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
[X-Content-Type-Options%3A%20%2Cnosniff]
expected: FAIL
[Content-Type-Options%3A%20nosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[embedded-opener-remove-frame.html]
expected: CRASH
[opener and "removed" embedded documents]
expected: FAIL

View file

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

View file

@ -172,3 +172,6 @@
[XHTML img usemap="http://example.org/#garbage-before-hash-id"]
expected: FAIL
[HTML (standards) IMG usemap="no-hash-name"]
expected: FAIL

View file

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

View file

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

View file

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

View file

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

View file

@ -2,3 +2,9 @@
[DOMParser]
expected: FAIL
[createHTMLDocument]
expected: FAIL
[<template>]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hidden-charset-case-sensitive.html]
[keyword _charset_]
expected: FAIL

View file

@ -0,0 +1,2 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[ignore-opens-during-unload.window.html]
expected: CRASH
expected: TIMEOUT
[ignore-opens-during-unload]
expected: FAIL

View file

@ -186,3 +186,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -186,3 +186,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -177,3 +177,9 @@
[Parsing: </> against <file://h/C:/a/b>]
expected: FAIL
[Parsing: <file:.//p> against <about:blank>]
expected: FAIL
[Parsing: <file:/.//p> against <about:blank>]
expected: FAIL

View file

@ -1,5 +1,4 @@
[realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL

View file

@ -1,4 +1,5 @@
[audiocontext-not-fully-active.html]
expected: TIMEOUT
[frame in navigated remote-site frame]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[import-in-moduleworker.html]
expected: ERROR
[Base URL in module dedicated workers: import]
expected: FAIL

View file

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

View file

@ -67,7 +67,7 @@ promise_test(async t => {
}, 'Verify write and read clipboard given platform-specific raw input');
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
This is a manual test because it writes/reads to the shared system
clipboard and thus cannot be run async with other tests that might interact
with the clipboard.
</p>

View file

@ -49,7 +49,7 @@ promise_test(async t => {
}, 'Verify write and read clipboard given 2 platform-neutral raw inputs');
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
This is a manual test because it writes/reads to the shared system
clipboard and thus cannot be run async with other tests that might interact
with the clipboard.
</p>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for negative values of text-underline-offset</title>
</head>
<body>
<div style="font-size: 48px; text-decoration: underline; text-underline-offset: 0px; text-decoration-skip: none;">Hello</div>
</body>
</html>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for negative values of text-underline-offset</title>
<meta name="assert" content="text-underline-offset: Negative values should not be clamped to zero">
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
<link rel="author" title="Apple Inc." href="http://www.apple.com/">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/4059">
<link rel="mismatch" href="reference/text-underline-offset-negative-notref.html">
</head>
<body>
<div style="font-size: 48px; text-decoration: underline; text-underline-offset: -20px; text-decoration-skip: none;">Hello</div>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!doctype html>
<title>Dynamic evaluation of media queries works fine in presence of empty media rule</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1669600">
<link rel="help" href="https://drafts.csswg.org/mediaqueries-4/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe width=500 height=300 frameborder=0></iframe>
<script>
let iframe = document.querySelector("iframe");
promise_test(async function (t) {
await new Promise(resolve => {
window.addEventListener("load", resolve);
});
let frameLoaded = new Promise(resolve => {
iframe.addEventListener("load", resolve);
});
iframe.srcdoc = `
<style>
:root { background-color: red; }
/* This one should never apply */
@media (min-width: 1500px) {}
/* This one should change and start matching */
@media (max-width: 400px) {
:root { background-color: lime; }
}
</style>
`;
await frameLoaded;
function getColor() {
return iframe.contentWindow.getComputedStyle(iframe.contentDocument.documentElement).backgroundColor;
}
assert_equals(getColor(), "rgb(255, 0, 0)", "Should start red");
iframe.width = 400;
assert_equals(getColor(), "rgb(0, 255, 0)", "Should turn green");
});
</script>

View file

@ -7,6 +7,10 @@
<style>
select {
color: transparent;
/* We make scrollbars transparent because some <option> elements can cause
overflow, which can cause scrollbars to be active in the test and
inactive in the reference. But the test only cares about the sizing. */
scrollbar-color: transparent transparent;
}
.fsMedium {
/* custom styling for some select elements, which is allowed to influence

View file

@ -10,6 +10,10 @@
select {
contain: size;
color: transparent;
/* We make scrollbars transparent because some <option> elements can cause
overflow, which can cause scrollbars to be active in the test and
inactive in the reference. But the test only cares about the sizing. */
scrollbar-color: transparent transparent;
}
.fsMedium {
/* custom styling for some select elements, which is allowed to influence

View file

@ -6,6 +6,7 @@
<script src="/resources/testharnessreport.js"></script>
<form target="child" method="GET" action="hidden-charset-case-sensitive-child.html">
<input type="hidden" name="_charset_">
<input type="hidden" name="_CHARSET_">
<input type="hidden" name="_ChArSeT_">
<input type="hidden" name="_charſet_">
</form>
@ -18,9 +19,10 @@ async_test(function() {
addEventListener("message", this.step_func_done(event => {
const params = new URL(event.data).searchParams;
assert_true(params.get("_charset_") != "", "lowercase valid");
assert_true(params.get("_ChArSeT_") == "", "mixed case invalid");
assert_true(params.get("_charſet_") == "", "non-ASCII invalid");
assert_equals(params.get("_charset_"), "UTF-8", "lowercase valid");
assert_equals(params.get("_CHARSET_"), "UTF-8", "uppercase valid");
assert_equals(params.get("_ChArSeT_"), "UTF-8", "mixed case invalid");
assert_equals(params.get("_charſet_"), "", "non-ASCII invalid");
}));
document.querySelector("form").submit();

View file

@ -1,17 +1,5 @@
[http2-context.sub.h2.any.sharedworker.html]
bug: https://bugs.webkit.org/show_bug.cgi?id=149850
expected:
if product == "safari" or product == "epiphany" or product == "webkit" or python_version == 3: ERROR
[http2-context.sub.h2.any.serviceworker.html]
expected:
if python_version == 3: ERROR
[http2-context.sub.h2.any.html]
expected:
if python_version == 3: ERROR
[http2-context.sub.h2.any.worker.html]
expected:
if python_version == 3: ERROR
if product == "safari" or product == "epiphany" or product == "webkit": ERROR

View file

@ -18,28 +18,3 @@
[HTTPS protocol, punycode subdomain #2]
expected:
if product == "epiphany" or product == "webkit": FAIL
[H2 protocol, no subdomain]
expected:
if python_version == 3: FAIL
[H2 protocol, www subdomain #1]
expected:
if python_version == 3: FAIL
[H2 protocol, www subdomain #2]
expected:
if python_version == 3: FAIL
[H2 protocol, www subdomain #3]
expected:
if python_version == 3: FAIL
[H2 protocol, punycode subdomain #1]
expected:
if python_version == 3: FAIL
[H2 protocol, punycode subdomain #2]
expected:
if python_version == 3: FAIL

View file

@ -0,0 +1,3 @@
[penPointerEventProperties.html]
expected:
if product == "firefox": ERROR

View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>TestDriver actions: pointerevent properties of pen type</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
div#test {
position: fixed;
touch-action: none;
top: 5px;
left: 5px;
width: 100px;
height: 100px;
background-color: blue;
}
</style>
<div id="test">
</div>
<script>
let typeList = [];
let pointerTypeList = [];
let buttonList = [];
let buttonsList = [];
let pointerMovePosition = [];
let pointerDownPosition = [];
let pointerUpPosition = [];
let pointerEnterPosition = [];
let pointerLeavePosition = [];
async_test(t => {
let test = document.getElementById("test");
var eventList = ['pointerover', 'pointerenter', 'pointermove', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
for (eventType of eventList) {
test.addEventListener(eventType, e => {
typeList.push(e.type);
pointerTypeList.push(e.pointerType);
buttonList.push(e.button);
buttonsList.push(e.buttons);
if (e.type == "pointermove")
pointerMovePosition.push([e.clientX, e.clientY].toString());
if (e.type == "pointerdown")
pointerDownPosition.push([e.clientX, e.clientY].toString());
if (e.type == "pointerup")
pointerUpPosition.push([e.clientX, e.clientY].toString());
if (e.type == "pointerenter")
pointerEnterPosition.push([e.clientX, e.clientY].toString());
if (e.type == "pointerleave")
pointerLeavePosition.push([e.clientX, e.clientY].toString());
});
}
let div = document.getElementById("test");
let actions = new test_driver.Actions()
.addPointer("penPointer1", "pen")
.pointerMove(0, 0)
.pointerMove(10, 10)
.pointerMove(0, 0, {origin: test})
.pointerDown()
.pointerMove(15, 0, {origin: test})
.pointerMove(30, 0, {origin: test})
.pointerUp()
.pointerMove(0, 0)
.send()
.then(t.step_func_done(() => {
assert_array_equals(typeList, ["pointerover", "pointerenter",
"pointermove", "pointermove", "pointerdown", "pointermove",
"pointermove", "pointerup", "pointerout", "pointerleave"]);
assert_array_equals(pointerTypeList, ["pen", "pen", "pen", "pen", "pen",
"pen", "pen", "pen", "pen", "pen"]);
assert_array_equals(buttonList, [-1, -1, -1, -1, 0, -1, -1, 0, -1, -1]);
assert_array_equals(buttonsList, [0, 0, 0, 0, 1, 1, 1, 0, 0, 0]);
assert_array_equals(pointerMovePosition, ["10,10", "55,55", "70,55", "85,55"]);
assert_array_equals(pointerDownPosition, ["55,55"]);
assert_array_equals(pointerUpPosition, ["85,55"]);
assert_array_equals(pointerEnterPosition, ["10,10"]);
assert_array_equals(pointerLeavePosition, ["0,0"]);
})).catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
});
</script>

View file

@ -54,8 +54,8 @@ interface PresentationConnection : EventTarget {
readonly attribute USVString id;
readonly attribute USVString url;
readonly attribute PresentationConnectionState state;
void close();
void terminate();
undefined close();
undefined terminate();
attribute EventHandler onconnect;
attribute EventHandler onclose;
attribute EventHandler onterminate;
@ -63,10 +63,10 @@ interface PresentationConnection : EventTarget {
// Communication
attribute BinaryType binaryType;
attribute EventHandler onmessage;
void send (DOMString message);
void send (Blob data);
void send (ArrayBuffer data);
void send (ArrayBufferView data);
undefined send (DOMString message);
undefined send (Blob data);
undefined send (ArrayBuffer data);
undefined send (ArrayBufferView data);
};
enum PresentationConnectionCloseReason { "error", "closed", "wentaway" };

View file

@ -6,8 +6,6 @@
constructor(optional SanitizerConfig sanitizerConfig = {});
DocumentFragment sanitize(DOMString input);
DOMString sanitizeToString(DOMString input);
readonly attribute SanitizerConfig creationOptions;
};
dictionary SanitizerConfig {

View file

@ -10,7 +10,7 @@ partial interface Navigator {
[SecureContext, Exposed=(Window)]
interface WakeLock {
Promise<WakeLockSentinel> request(WakeLockType type);
Promise<WakeLockSentinel> request(optional WakeLockType type = "screen");
};
[SecureContext, Exposed=(Window)]

View file

@ -46,8 +46,8 @@ dictionary MIDIOptions {
};
[SecureContext, Exposed=Window] interface MIDIOutput : MIDIPort {
void send(sequence<octet> data, optional DOMHighResTimeStamp timestamp = 0);
void clear();
undefined send(sequence<octet> data, optional DOMHighResTimeStamp timestamp = 0);
undefined clear();
};
enum MIDIPortType {

View file

@ -1,7 +1,7 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: WebRTC 1.0: Real-time Communication Between Browsers (https://w3c.github.io/webrtc-pc/)
// Source: WebRTC 1.0: Real-Time Communication Between Browsers (https://w3c.github.io/webrtc-pc/)
dictionary RTCConfiguration {
sequence<RTCIceServer> iceServers;

View file

@ -705,6 +705,7 @@ WEB-PLATFORM.TEST:signed-exchange/resources/generate-test-sxgs.sh
WEB-PLATFORM.TEST:web-bundle/resources/generate-test-wbns.sh
WEB-PLATFORM.TEST:web-bundle/resources/wbn/*.wbn
WEB-PLATFORM.TEST:web-bundle/subresource-loading/subresource-loading-from-web-bundle.tentative.html
WEB-PLATFORM.TEST:web-bundle/subresource-loading/subresource-loading-path-restriction.tentative.html
# Tests that depend on resources in /gen/ in Chromium:
# https://github.com/web-platform-tests/wpt/issues/16455

View file

@ -1,19 +0,0 @@
//META: title=navigator.wakeLock.request() with invalid type
promise_test(async t => {
return promise_rejects_js(t, TypeError, navigator.wakeLock.request());
}, "'TypeError' is thrown when set an empty wake lock type");
promise_test(t => {
const invalidTypes = [
"invalid",
null,
123,
{},
"",
true
];
return Promise.all(invalidTypes.map(invalidType => {
return promise_rejects_js(t, TypeError, navigator.wakeLock.request(invalidType));
}));
}, "'TypeError' is thrown when set an invalid wake lock type");

View file

@ -0,0 +1,21 @@
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
promise_test(async t => {
await test_driver.set_permission(
{name: 'screen-wake-lock'}, 'granted', false);
const lock = await navigator.wakeLock.request();
t.add_cleanup(() => {
lock.release();
});
assert_equals(lock.type, 'screen');
}, '\'type\' parameter in WakeLock.request() defaults to \'screen\'');
promise_test(t => {
const invalidTypes = ['invalid', null, 123, {}, '', true];
return Promise.all(invalidTypes.map(invalidType => {
return promise_rejects_js(
t, TypeError, navigator.wakeLock.request(invalidType));
}));
}, '\'TypeError\' is thrown when set an invalid wake lock type');

View file

@ -1,19 +1,20 @@
'use strict';
// Create a ReadableStream that will pass the tests in
// testTransferredReadableStream(), below.
function createOriginalReadableStream() {
(() => {
// Create a ReadableStream that will pass the tests in
// testTransferredReadableStream(), below.
function createOriginalReadableStream() {
return new ReadableStream({
start(controller) {
controller.enqueue('a');
controller.close();
}
});
}
}
// Common tests to roughly determine that |rs| is a correctly transferred
// version of a stream created by createOriginalReadableStream().
function testTransferredReadableStream(rs) {
// Common tests to roughly determine that |rs| is a correctly transferred
// version of a stream created by createOriginalReadableStream().
function testTransferredReadableStream(rs) {
assert_equals(rs.constructor, ReadableStream,
'rs should be a ReadableStream in this realm');
assert_true(rs instanceof ReadableStream,
@ -29,14 +30,14 @@ function testTransferredReadableStream(rs) {
}).then(({done}) => {
assert_true(done, 'done should be true');
});
}
}
function testMessage(msg) {
function testMessage(msg) {
assert_array_equals(msg.ports, [], 'there should be no ports in the event');
return testTransferredReadableStream(msg.data);
}
}
function testMessageEvent(target) {
function testMessageEvent(target) {
return new Promise((resolve, reject) => {
target.addEventListener('message', ev => {
try {
@ -46,9 +47,9 @@ function testMessageEvent(target) {
}
}, {once: true});
});
}
}
function testMessageEventOrErrorMessage(target) {
function testMessageEventOrErrorMessage(target) {
return new Promise((resolve, reject) => {
target.addEventListener('message', ev => {
if (typeof ev.data === 'string') {
@ -64,9 +65,9 @@ function testMessageEventOrErrorMessage(target) {
}
}, {once: true});
});
}
}
function checkTestResults(target) {
function checkTestResults(target) {
return new Promise((resolve, reject) => {
target.onmessage = msg => {
// testharness.js sends us objects which we need to ignore.
@ -80,12 +81,12 @@ function checkTestResults(target) {
}
};
});
}
}
// These tests assume that a transferred ReadableStream will behave the same
// regardless of how it was transferred. This enables us to simply transfer the
// stream to ourselves.
function createTransferredReadableStream(underlyingSource) {
// These tests assume that a transferred ReadableStream will behave the same
// regardless of how it was transferred. This enables us to simply transfer the
// stream to ourselves.
function createTransferredReadableStream(underlyingSource) {
const original = new ReadableStream(underlyingSource);
const promise = new Promise((resolve, reject) => {
addEventListener('message', msg => {
@ -99,9 +100,9 @@ function createTransferredReadableStream(underlyingSource) {
});
postMessage(original, '*', [original]);
return promise;
}
}
function recordingTransferredReadableStream(underlyingSource, strategy) {
function recordingTransferredReadableStream(underlyingSource, strategy) {
const original = recordingReadableStream(underlyingSource, strategy);
const promise = new Promise((resolve, reject) => {
addEventListener('message', msg => {
@ -118,4 +119,14 @@ function recordingTransferredReadableStream(underlyingSource, strategy) {
});
postMessage(original, '*', [original]);
return promise;
}
}
self.createOriginalReadableStream = createOriginalReadableStream;
self.testMessage = testMessage;
self.testMessageEvent = testMessageEvent;
self.testMessageEventOrErrorMessage = testMessageEventOrErrorMessage;
self.checkTestResults = checkTestResults;
self.createTransferredReadableStream = createTransferredReadableStream;
self.recordingTransferredReadableStream = recordingTransferredReadableStream;
})();

View file

@ -1,4 +1,4 @@
flake8==3.8.3
flake8==3.8.4
pycodestyle==2.6.0
pyflakes==2.2.0
pep8-naming==0.11.1

View file

@ -538,7 +538,7 @@ def start_servers(host, ports, paths, routes, bind_address, config, **kwargs):
# If trying to start HTTP/2.0 server, check compatibility
if scheme == 'h2' and not http2_compatible():
logger.error('Cannot start HTTP/2.0 server as the environment is not compatible. ' +
'Requires Python 2.7.10+ (< 3.0) and OpenSSL 1.0.2+')
'Requires Python 2.7.10+ or 3.6+ and OpenSSL 1.0.2+')
continue
for port in ports:

View file

@ -321,16 +321,16 @@ class TestH2Handler(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 203
assert resp.headers['test'][0] == 'passed'
assert resp.read() == ''
assert resp.headers['test'][0] == b'passed'
assert resp.read() == b''
def test_only_main(self):
self.conn.request("GET", '/test_tuple_3.py')
resp = self.conn.get_response()
assert resp.status == 202
assert resp.headers['Content-Type'][0] == 'text/html'
assert resp.headers['X-Test'][0] == 'PASS'
assert resp.headers['Content-Type'][0] == b'text/html'
assert resp.headers['X-Test'][0] == b'PASS'
assert resp.read() == b'PASS'
def test_handle_data(self):
@ -345,7 +345,7 @@ class TestH2Handler(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 203
assert resp.headers['test'][0] == 'passed'
assert resp.headers['test'][0] == b'passed'
assert resp.read() == b'!dlrow olleh'
def test_no_main_or_handlers(self):
@ -367,16 +367,16 @@ class TestH2Handler(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 203
assert resp.headers['test'][0] == 'passed'
assert resp.read() == ''
assert resp.headers['test'][0] == b'passed'
assert resp.read() == b''
# 2nd .py resource
self.conn.request("GET", '/test_tuple_3.py')
resp = self.conn.get_response()
assert resp.status == 202
assert resp.headers['Content-Type'][0] == 'text/html'
assert resp.headers['X-Test'][0] == 'PASS'
assert resp.headers['Content-Type'][0] == b'text/html'
assert resp.headers['X-Test'][0] == b'PASS'
assert resp.read() == b'PASS'
# 3rd .py resource
@ -384,8 +384,8 @@ class TestH2Handler(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 203
assert resp.headers['test'][0] == 'passed'
assert resp.read() == ''
assert resp.headers['test'][0] == b'passed'
assert resp.read() == b''
class TestWorkersHandler(TestWrapperHandlerUsingServer):

View file

@ -206,7 +206,7 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 202
assert [x for x in resp.headers.items()] == [('server', 'test-h2'), ('test', 'PASS')]
assert [x for x in resp.headers.items()] == [(b'server', b'test-h2'), (b'test', b'PASS')]
assert resp.read() == data
def test_push(self):
@ -248,12 +248,12 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 202
assert [x for x in resp.headers.items()] == [('server', 'test-h2'), ('test', 'PASS')]
assert [x for x in resp.headers.items()] == [(b'server', b'test-h2'), (b'test', b'PASS')]
assert resp.read() == data
push_promise = next(self.conn.get_pushes())
push = push_promise.get_response()
assert push_promise.path == '/push-test'
assert push_promise.path == b'/push-test'
assert push.status == 203
assert push.read() == push_data
@ -273,7 +273,7 @@ class TestH2Response(TestUsingH2Server):
def test_file_like_response(self):
@wptserve.handlers.handler
def handler(request, response):
content = BytesIO("Hello, world!")
content = BytesIO(b"Hello, world!")
response.content = content
route = ("GET", "/h2test/test_file_like_response", handler)
@ -282,7 +282,7 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 200
assert resp.read() == "Hello, world!"
assert resp.read() == b"Hello, world!"
def test_list_response(self):
@wptserve.handlers.handler
@ -295,7 +295,7 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 200
assert resp.read() == "helloworld"
assert resp.read() == b"helloworld"
def test_content_longer_than_frame_size(self):
@wptserve.handlers.handler
@ -312,7 +312,7 @@ class TestH2Response(TestUsingH2Server):
assert resp.status == 200
payload_size = int(resp.headers['payload_size'][0])
assert payload_size
assert resp.read() == "a" * (payload_size + 5)
assert resp.read() == b"a" * (payload_size + 5)
def test_encode(self):
@wptserve.handlers.handler
@ -343,8 +343,8 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 204
assert resp.headers['server'][0] == 'TEST-H2'
assert resp.read() == ''
assert resp.headers['server'][0] == b'TEST-H2'
assert resp.read() == b''
def test_raw_header_frame_invalid(self):
@wptserve.handlers.handler
@ -370,7 +370,7 @@ class TestH2Response(TestUsingH2Server):
self.server.router.register(*route)
sid = self.conn.request(route[0], route[1])
assert self.conn.streams[sid]._read() == 'Hello world'
assert self.conn.streams[sid]._read() == b'Hello world'
def test_raw_header_continuation_frame(self):
@wptserve.handlers.handler
@ -389,8 +389,8 @@ class TestH2Response(TestUsingH2Server):
resp = self.conn.get_response()
assert resp.status == 204
assert resp.headers['server'][0] == 'TEST-H2'
assert resp.read() == ''
assert resp.headers['server'][0] == b'TEST-H2'
assert resp.read() == b''
if __name__ == '__main__':
unittest.main()

View file

@ -413,9 +413,9 @@ class H2Response(Response):
item = None
item_iter = self.iter_content()
try:
item = item_iter.next()
item = next(item_iter)
while True:
check_last = item_iter.next()
check_last = next(item_iter)
self.writer.write_data(item, last=False)
item = check_last
except StopIteration:
@ -451,6 +451,13 @@ class H2ResponseWriter(object):
secondary_headers = [] # Non ':' prefixed headers are to be added afterwards
for header, value in headers:
# h2_headers are native strings
# header field names are strings of ASCII
if isinstance(header, binary_type):
header = header.decode('ascii')
# value in headers can be either string or integer
if isinstance(value, binary_type):
value = self.decode(value)
if header in h2_headers:
header = ':' + header
formatted_headers.append((header, str(value)))
@ -635,6 +642,15 @@ class H2ResponseWriter(object):
self.content_written = True
self.socket.sendall(raw_data)
def decode(self, data):
"""Convert bytes to unicode according to response.encoding."""
if isinstance(data, binary_type):
return data.decode(self._response.encoding)
elif isinstance(data, text_type):
return data
else:
raise ValueError(type(data))
def encode(self, data):
"""Convert unicode to bytes according to response.encoding."""
if isinstance(data, binary_type):

View file

@ -26,7 +26,7 @@ from .logger import get_logger
from .request import Server, Request, H2Request
from .response import Response, H2Response
from .router import Router
from .utils import HTTPException
from .utils import HTTPException, isomorphic_decode
from .constants import h2_headers
# We need to stress test that browsers can send/receive many headers (there is
@ -506,6 +506,8 @@ class H2Headers(dict):
def __init__(self, headers):
self.raw_headers = OrderedDict()
for key, val in headers:
key = isomorphic_decode(key)
val = isomorphic_decode(val)
self.raw_headers[key] = val
dict.__setitem__(self, self._convert_h2_header_to_h1(key), val)

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