Update web-platform-tests to revision b202bbb5aa0d235b22bac11fe902eab1094ef9d2

This commit is contained in:
WPT Sync Bot 2018-03-13 21:24:22 -04:00
parent 9a6c96808b
commit e90dd8bc6b
43 changed files with 669 additions and 286 deletions

View file

@ -1,17 +1,16 @@
[createImageBitmap-drawImage.html] [createImageBitmap-drawImage.html]
type: testharness type: testharness
expected: TIMEOUT
[createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap] [createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap]
expected: FAIL expected: FAIL
[createImageBitmap from a Blob, and drawImage on the created ImageBitmap] [createImageBitmap from a Blob, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap] [createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap]
expected: FAIL expected: FAIL
[createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from an ImageData, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageData, and drawImage on the created ImageBitmap]
expected: FAIL expected: FAIL
@ -44,13 +43,13 @@
expected: FAIL expected: FAIL
[createImageBitmap from an ImageData with negative sw/sh, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageData with negative sw/sh, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap] [createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a bitmap HTMLImageElement, and drawImage on the created ImageBitmap] [createImageBitmap from a bitmap HTMLImageElement, and drawImage on the created ImageBitmap]
expected: FAIL expected: FAIL
@ -158,26 +157,26 @@
expected: FAIL expected: FAIL
[createImageBitmap from an ImageData scaled up, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageData scaled up, and drawImage on the created ImageBitmap]
expected: TIMEOUT expected: FAIL
[createImageBitmap from an ImageData resized, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageData resized, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from an ImageBitmap scaled down, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageBitmap scaled down, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from an ImageBitmap scaled up, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageBitmap scaled up, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from an ImageBitmap resized, and drawImage on the created ImageBitmap] [createImageBitmap from an ImageBitmap resized, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a Blob scaled down, and drawImage on the created ImageBitmap] [createImageBitmap from a Blob scaled down, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a Blob scaled up, and drawImage on the created ImageBitmap] [createImageBitmap from a Blob scaled up, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL
[createImageBitmap from a Blob resized, and drawImage on the created ImageBitmap] [createImageBitmap from a Blob resized, and drawImage on the created ImageBitmap]
expected: NOTRUN expected: FAIL

View file

@ -14869,6 +14869,18 @@
{} {}
] ]
], ],
"payment-request/payment-request-abort-method-manual.https.html": [
[
"/payment-request/payment-request-abort-method-manual.https.html",
{}
]
],
"payment-request/payment-request-canmakepayment-method-manual.https.html": [
[
"/payment-request/payment-request-canmakepayment-method-manual.https.html",
{}
]
],
"payment-request/payment-response/complete-method-manual.https.html": [ "payment-request/payment-response/complete-method-manual.https.html": [
[ [
"/payment-request/payment-response/complete-method-manual.https.html", "/payment-request/payment-response/complete-method-manual.https.html",
@ -47231,6 +47243,66 @@
{} {}
] ]
], ],
"css/CSS2/floats-clear/clear-on-child-with-margins.html": [
[
"/css/CSS2/floats-clear/clear-on-child-with-margins.html",
[
[
"/css/reference/ref-filled-green-100px-square-only.html",
"=="
]
],
{}
]
],
"css/CSS2/floats-clear/clear-on-parent-and-child.html": [
[
"/css/CSS2/floats-clear/clear-on-parent-and-child.html",
[
[
"/css/reference/ref-filled-green-200px-square.html",
"=="
]
],
{}
]
],
"css/CSS2/floats-clear/clear-on-parent-with-margins-no-clearance.html": [
[
"/css/CSS2/floats-clear/clear-on-parent-with-margins-no-clearance.html",
[
[
"/css/reference/ref-filled-green-100px-square-only.html",
"=="
]
],
{}
]
],
"css/CSS2/floats-clear/clear-on-parent-with-margins.html": [
[
"/css/CSS2/floats-clear/clear-on-parent-with-margins.html",
[
[
"/css/reference/ref-filled-green-200px-square.html",
"=="
]
],
{}
]
],
"css/CSS2/floats-clear/clear-on-parent.html": [
[
"/css/CSS2/floats-clear/clear-on-parent.html",
[
[
"/css/reference/ref-filled-green-200px-square.html",
"=="
]
],
{}
]
],
"css/CSS2/floats-clear/clearance-006.xht": [ "css/CSS2/floats-clear/clearance-006.xht": [
[ [
"/css/CSS2/floats-clear/clearance-006.xht", "/css/CSS2/floats-clear/clearance-006.xht",
@ -190268,6 +190340,16 @@
{} {}
] ]
], ],
"client-hints/accept_ch.https.html.headers": [
[
{}
]
],
"client-hints/echo_device_memory_header_received.py": [
[
{}
]
],
"clipboard-apis/OWNERS": [ "clipboard-apis/OWNERS": [
[ [
{} {}
@ -285098,6 +285180,11 @@
{} {}
] ]
], ],
"interfaces/encoding.idl": [
[
{}
]
],
"interfaces/encrypted-media.idl": [ "interfaces/encrypted-media.idl": [
[ [
{} {}
@ -307977,6 +308064,12 @@
{} {}
] ]
], ],
"client-hints/accept_ch.https.html": [
[
"/client-hints/accept_ch.https.html",
{}
]
],
"clipboard-apis/async-interfaces.https.html": [ "clipboard-apis/async-interfaces.https.html": [
[ [
"/clipboard-apis/async-interfaces.https.html", "/clipboard-apis/async-interfaces.https.html",
@ -317007,6 +317100,12 @@
{} {}
] ]
], ],
"css/css-typed-om/the-stylepropertymap/properties/scroll-padding.html": [
[
"/css/css-typed-om/the-stylepropertymap/properties/scroll-padding.html",
{}
]
],
"css/css-typed-om/the-stylepropertymap/properties/shape-outside.html": [ "css/css-typed-om/the-stylepropertymap/properties/shape-outside.html": [
[ [
"/css/css-typed-om/the-stylepropertymap/properties/shape-outside.html", "/css/css-typed-om/the-stylepropertymap/properties/shape-outside.html",
@ -349753,18 +349852,6 @@
{} {}
] ]
], ],
"payment-request/payment-request-abort-method.https.html": [
[
"/payment-request/payment-request-abort-method.https.html",
{}
]
],
"payment-request/payment-request-canmakepayment-method.https.html": [
[
"/payment-request/payment-request-canmakepayment-method.https.html",
{}
]
],
"payment-request/payment-request-constructor-crash.https.html": [ "payment-request/payment-request-constructor-crash.https.html": [
[ [
"/payment-request/payment-request-constructor-crash.https.html", "/payment-request/payment-request-constructor-crash.https.html",
@ -390541,7 +390628,7 @@
"support" "support"
], ],
"./.gitignore": [ "./.gitignore": [
"c914a6a4aa7fc0ae0e948219c7949481d616d1c3", "4c0250a2fdf8f32f9df4db278c03f0a8722a90d7",
"support" "support"
], ],
"./.gitmodules": [ "./.gitmodules": [
@ -401316,6 +401403,18 @@
"10f5f9d409ef513edb129e0e8522aa5f74d51ce8", "10f5f9d409ef513edb129e0e8522aa5f74d51ce8",
"support" "support"
], ],
"client-hints/accept_ch.https.html": [
"b54ae9b17399e0fe4472fedbf1badd67d28e68f3",
"testharness"
],
"client-hints/accept_ch.https.html.headers": [
"bf59baf9a030d117964df414efc11ddb07e7a7fa",
"support"
],
"client-hints/echo_device_memory_header_received.py": [
"defa16c455bebc2589c058d0d888326d667e317a",
"support"
],
"clipboard-apis/OWNERS": [ "clipboard-apis/OWNERS": [
"bae753666bda85e9805a5e2fad80ba71459b8aba", "bae753666bda85e9805a5e2fad80ba71459b8aba",
"support" "support"
@ -440156,6 +440255,26 @@
"3f902ea05caf3cb71e978749bd47b120d10366e2", "3f902ea05caf3cb71e978749bd47b120d10366e2",
"reftest" "reftest"
], ],
"css/CSS2/floats-clear/clear-on-child-with-margins.html": [
"69b04e20fa82677e4d2736bd6ec9c370147e4061",
"reftest"
],
"css/CSS2/floats-clear/clear-on-parent-and-child.html": [
"bbf7831640ee2aa3e29aa6695682d1e14971948b",
"reftest"
],
"css/CSS2/floats-clear/clear-on-parent-with-margins-no-clearance.html": [
"d4b2bf3b4b6761c9531859e6cedb9d08a928880f",
"reftest"
],
"css/CSS2/floats-clear/clear-on-parent-with-margins.html": [
"dbaee65a956a9b0dfc8b1bbb3ae70bd29bb02c6c",
"reftest"
],
"css/CSS2/floats-clear/clear-on-parent.html": [
"63c9122c39983b4c3a7d10f92399e746411022c3",
"reftest"
],
"css/CSS2/floats-clear/clearance-006-ref.xht": [ "css/CSS2/floats-clear/clearance-006-ref.xht": [
"2305823fd342085286fe1f5e0cdb27d7cd6fe436", "2305823fd342085286fe1f5e0cdb27d7cd6fe436",
"support" "support"
@ -521545,7 +521664,7 @@
"testharness" "testharness"
], ],
"css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html": [ "css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html": [
"9d855c711332b344078fc89bac6ed67091fa1ddd", "e2d56515f3580649fc9cc8188b39056beb030036",
"testharness" "testharness"
], ],
"css/css-typed-om/stylevalue-subclasses/numeric-objects/cssnumericvalue-multiply-two-types.tentative.html": [ "css/css-typed-om/stylevalue-subclasses/numeric-objects/cssnumericvalue-multiply-two-types.tentative.html": [
@ -521884,6 +522003,10 @@
"68a2611eaf9eecb7393c2b0db0f4378ebe285f22", "68a2611eaf9eecb7393c2b0db0f4378ebe285f22",
"testharness" "testharness"
], ],
"css/css-typed-om/the-stylepropertymap/properties/scroll-padding.html": [
"d37d336e4695e5055706a7822572b81b943fdbd4",
"testharness"
],
"css/css-typed-om/the-stylepropertymap/properties/shape-outside.html": [ "css/css-typed-om/the-stylepropertymap/properties/shape-outside.html": [
"3189c7b3903d30f31836ea845aebecf599198c79", "3189c7b3903d30f31836ea845aebecf599198c79",
"testharness" "testharness"
@ -532025,7 +532148,7 @@
"testharness" "testharness"
], ],
"css/cssom/inline-style-001.html": [ "css/cssom/inline-style-001.html": [
"da50f9738f161a0bb9af5a5636634346bb683fa9", "4c58b6153eabe796749dcaf181e03d7dce2c9c07",
"testharness" "testharness"
], ],
"css/cssom/insertRule-charset-no-index.html": [ "css/cssom/insertRule-charset-no-index.html": [
@ -532061,11 +532184,11 @@
"reftest" "reftest"
], ],
"css/cssom/medialist-interfaces-001.html": [ "css/cssom/medialist-interfaces-001.html": [
"32d486ecdd41418e734be028c150b0183b8d3316", "bae698d83d94e35d31750e0690e13c1ab5334379",
"testharness" "testharness"
], ],
"css/cssom/medialist-interfaces-002.html": [ "css/cssom/medialist-interfaces-002.html": [
"20d4d9e76e0331816aed5f70182dee6966e568e7", "e04c0d3c8533660f524310350c7e71defa4888b2",
"testharness" "testharness"
], ],
"css/cssom/medialist-interfaces-003.html": [ "css/cssom/medialist-interfaces-003.html": [
@ -532073,7 +532196,7 @@
"testharness" "testharness"
], ],
"css/cssom/medialist-interfaces-004.html": [ "css/cssom/medialist-interfaces-004.html": [
"9558544a6785ac732150b8a50bedbaf3615fa890", "a8a6a1b9966526de2d846baf6176880353f84e1a",
"testharness" "testharness"
], ],
"css/cssom/overflow-serialization.html": [ "css/cssom/overflow-serialization.html": [
@ -532121,7 +532244,7 @@
"testharness" "testharness"
], ],
"css/cssom/style-sheet-interfaces-001.html": [ "css/cssom/style-sheet-interfaces-001.html": [
"6dbb52cd85cb3bbc711a3569e0f253d7086a43a0", "3fbe87bc1e363bf59a84c5fbdd8b2450909c6ca1",
"testharness" "testharness"
], ],
"css/cssom/style-sheet-interfaces-002.html": [ "css/cssom/style-sheet-interfaces-002.html": [
@ -546717,7 +546840,7 @@
"testharness" "testharness"
], ],
"encoding/idlharness.html": [ "encoding/idlharness.html": [
"7f1eee3e9d3554fe49e04014501ed12bc57b89e8", "fa520e077bce06a56406cb61bb8c150264699624",
"testharness" "testharness"
], ],
"encoding/iso-2022-jp-decoder.html": [ "encoding/iso-2022-jp-decoder.html": [
@ -549641,7 +549764,7 @@
"testharness" "testharness"
], ],
"fetch/api/redirect/redirect-location.js": [ "fetch/api/redirect/redirect-location.js": [
"3b48bf04659cc82462c3f33db47fd2f44f63c0c3", "c8795b2a372e365e1b6e052d8a3309f3bfb2c143",
"support" "support"
], ],
"fetch/api/redirect/redirect-method-worker.html": [ "fetch/api/redirect/redirect-method-worker.html": [
@ -571064,6 +571187,10 @@
"2d65a8029a80cfc97398d18f911f1ae65067e765", "2d65a8029a80cfc97398d18f911f1ae65067e765",
"support" "support"
], ],
"interfaces/encoding.idl": [
"0dd77d1c6d854b0bdd003107c2385a224e1953f8",
"support"
],
"interfaces/encrypted-media.idl": [ "interfaces/encrypted-media.idl": [
"ef1f1432c42fc6d01f3bfbd576fa5c7de349de96", "ef1f1432c42fc6d01f3bfbd576fa5c7de349de96",
"support" "support"
@ -571101,7 +571228,7 @@
"support" "support"
], ],
"interfaces/magnetometer.idl": [ "interfaces/magnetometer.idl": [
"78fdc6ec345a5f05e86cb104cb025689638bbe17", "ffac480912edba82886fef6d5368092d237a0c7f",
"support" "support"
], ],
"interfaces/mediacapture-main.idl": [ "interfaces/mediacapture-main.idl": [
@ -571109,7 +571236,7 @@
"support" "support"
], ],
"interfaces/orientation-sensor.idl": [ "interfaces/orientation-sensor.idl": [
"d75a765c9456c21ed2733fa89a20f3e2d0eb2131", "1f0698a8611726b1ba724a5d7a0961e836c7b07e",
"support" "support"
], ],
"interfaces/payment-handler.idl": [ "interfaces/payment-handler.idl": [
@ -580860,13 +580987,13 @@
"d269e8378f2a84ba96c981536667817e0db9e2d1", "d269e8378f2a84ba96c981536667817e0db9e2d1",
"testharness" "testharness"
], ],
"payment-request/payment-request-abort-method.https.html": [ "payment-request/payment-request-abort-method-manual.https.html": [
"30c62af4a05a4d83cbbd1e82d0df62bae9a85e96", "6ed75457d922671e7b2ffbf1c0d22f69bbb681e4",
"testharness" "manual"
], ],
"payment-request/payment-request-canmakepayment-method.https.html": [ "payment-request/payment-request-canmakepayment-method-manual.https.html": [
"0d863558b996df81a36207201bbf8c649688845d", "40e5bf0445eedb6bb78bd61fa4a468652462a14d",
"testharness" "manual"
], ],
"payment-request/payment-request-constructor-crash.https.html": [ "payment-request/payment-request-constructor-crash.https.html": [
"383d1c3f9505ee63d504bee87e13efa90ba49f3d", "383d1c3f9505ee63d504bee87e13efa90ba49f3d",
@ -599973,7 +600100,7 @@
"testharness" "testharness"
], ],
"web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html": [ "web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html": [
"a7da92b9624750eccb9dce1d32e522fdbb65176f", "aa5f258132490ade2dbd9485c85f749cbab293a5",
"testharness" "testharness"
], ],
"web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html": [ "web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html": [

View file

@ -0,0 +1,2 @@
[clear-on-child-with-margins.html]
expected: FAIL

View file

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

View file

@ -1,5 +1,6 @@
[inline-style-001.html] [inline-style-001.html]
type: testharness type: testharness
expected: TIMEOUT
[CSSStyleDeclaration_accessible] [CSSStyleDeclaration_accessible]
expected: FAIL expected: FAIL

View file

@ -12,3 +12,6 @@
[mediatest_medialist_serialize_lexicographical] [mediatest_medialist_serialize_lexicographical]
expected: FAIL expected: FAIL
[mediatest_medialist_serialize_order]
expected: FAIL

View file

@ -1,8 +1,5 @@
[style-sheet-interfaces-001.html] [style-sheet-interfaces-001.html]
type: testharness type: testharness
[sheet_property]
expected: FAIL
[CSSStyleSheet_properties] [CSSStyleSheet_properties]
expected: FAIL expected: FAIL

View file

@ -11,3 +11,6 @@
[TextDecoder interface: new TextDecoder() must inherit property "ignoreBOM" with the proper type] [TextDecoder interface: new TextDecoder() must inherit property "ignoreBOM" with the proper type]
expected: FAIL expected: FAIL
[idlharness test: Encoding Living Standard API]
expected: FAIL

View file

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

View file

@ -0,0 +1,5 @@
[rapid-resizing.html]
expected: TIMEOUT
[Overall test]
expected: NOTRUN

View file

@ -1,6 +1,5 @@
[shader-with-non-reserved-words.html] [shader-with-non-reserved-words.html]
type: testharness type: testharness
expected: TIMEOUT
[WebGL test #1696: shader with: 'dmat2' failed to compile] [WebGL test #1696: shader with: 'dmat2' failed to compile]
expected: FAIL expected: FAIL
@ -145,6 +144,3 @@
[WebGL test #1862: shader with: 'dmat4x4' failed to compile] [WebGL test #1862: shader with: 'dmat4x4' failed to compile]
expected: FAIL expected: FAIL
[Overall test]
expected: NOTRUN

View file

@ -1,20 +1,30 @@
*# # Python
*.py[co] *.py[co]
.virtualenv/
_venv/
.cache/
.pytest_cache/
# Node
node_modules/
# WPT repo stuff
/MANIFEST.json
testharness_runner.html
!/testharness_runner.html
!/tools/wptrunner/wptrunner/testharness_runner.html
_certs
config.json
# Various OS/editor specific files
*#
*.sw[po] *.sw[po]
*~ *~
MANIFEST.json
!content-security-policy/support/manifest.json
!payment-handler/manifest.json
\#* \#*
_certs
.virtualenv
config.json
node_modules
scratch scratch
testharness_runner.html .idea/
webdriver/.idea
.vscode/ .vscode/
.DS_Store .DS_Store
*.rej *.rej
_venv
webdriver/.cache

View file

@ -0,0 +1,30 @@
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// If the response for the HTML file contains "Accept-CH: device-memory" in
// the response headers, then the browser should attach device-memory client
// hint in the HTTP request headers. Test this functionality by fetching an
// XHR from this page. The response headers for this page include
// "Accept-CH: device-memory".
//
// echo_device_memory_header_received.py includes "device-memory-received" in
// the response headers only if the request included "device-memory" in the
// headers.
promise_test(t => {
return fetch("/client-hints/echo_device_memory_header_received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser included "device-memory" in the headers when
// fetching the XHR.
assert_true(r.headers.has("device-memory-received"));
});
}, "Accept-CH header test");
</script>
</body>
</html>

View file

@ -0,0 +1 @@
Accept-CH: device-memory

View file

@ -0,0 +1,8 @@
def main(request, response):
"""
Simple handler that sets a response header based on if device-memory
request header was received or not.
"""
if "device-memory" in request.headers:
response.headers.set("device-memory-received", "true")

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<title>Child of block with clear</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="position:relative; top:-20px;">
<div style="float:left; margin-top:20px; width:50px; height:50px; background:green;"></div>
<div style="padding-top:1px;">
<div style="margin-top:19px; width:100px; background:green;">
<div style="clear:left; margin-top:25px; width:100px; height:50px; background:green;"></div>
</div>
</div>
</div>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>Child of block with clear</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="container" style="overflow:hidden; width:200px; height:200px; background:red;">
<div style="float:left; width:10px; height:50px;"></div>
<div style="float:right; width:10px; height:100px;"></div>
<div style="clear:right;">
<div style="clear:left; height:200px; background:green;"></div>
</div>
<div style="height:10000px;"></div>
</div>
<script>
document.getElementById("container").scrollTop = 100;
</script>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Child of block with clear</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="position:relative; z-index:-1; top:-50px; width:100px; background:green;">
<div style="float:left; width:100px; height:50px; background:white;"></div>
<div style="clear:left; margin-top:25px;">
<div style="height:50px; margin-top:150px; background:white;"></div>
</div>
</div>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Child of block with clear</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="width:200px; height:200px; background:red;">
<div style="float:left; width:200px; height:100px; background:green;"></div>
<div style="clear:left; margin-top:100px;">
<div style="height:100px; margin-top:-1000px; background:green;"></div>
</div>
</div>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Child of block with clear</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="width:200px; height:200px; background:red;">
<div style="float:left; width:200px; height:100px; background:green;"></div>
<div style="clear:left;">
<div style="height:100px; background:green;"></div>
</div>
</div>

View file

@ -9,8 +9,8 @@
'use strict'; 'use strict';
const gInvalidTestUnits = [ const gInvalidTestUnits = [
{ value: '', desc: 'an empty string' }, { unit: '', desc: 'an empty string' },
{ value: 'lemon', desc: 'an invalid unit' }, { unit: 'lemon', desc: 'an invalid unit' },
]; ];
for (const {unit, desc} of gInvalidTestUnits) { for (const {unit, desc} of gInvalidTestUnits) {

View file

@ -0,0 +1,34 @@
<!doctype html>
<meta charset="utf-8">
<title>scroll-padding related properties</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
for (const suffix of ['top', 'left', 'right', 'bottom']) {
runPropertyTests('scroll-padding-' + suffix, [
{ syntax: '<percentage>' },
{ syntax: '<length>' },
]);
}
for (const suffix of ['inline-start', 'block-start', 'inline-end', 'block-end']) {
runPropertyTests('scroll-padding-' + suffix, [
{ syntax: '<percentage>' },
{ syntax: '<length>' },
]);
}
runUnsupportedPropertyTests('scroll-padding',
['0%', '1px 2px', '3% 4px 5%', '6px 7% 8% 9px']
);
</script>

View file

@ -16,15 +16,14 @@
<script type="text/javascript"> <script type="text/javascript">
test(function() { test(function() {
var test = document.getElementById("test"); var test = document.getElementById("test");
assert_own_property(test, "style"); assert_idl_attribute(test, "style");
assert_readonly(test, "style");
declaration = test.style; declaration = test.style;
}, "CSSStyleDeclaration_accessible", { }, "CSSStyleDeclaration_accessible", {
assert: "Can access CSSStyleDeclaration through style property" assert: "Can access CSSStyleDeclaration through style property"
}); });
test(function() { test(function() {
assert_regexp_match(declaration.cssText, /margin-left: 5px;\s*/); assert_equals(declaration.cssText, "margin-left: 5px;");
assert_equals(declaration.getPropertyValue("margin-left"), "5px"); assert_equals(declaration.getPropertyValue("margin-left"), "5px");
}, "read", { }, "read", {
assert: "initial property values are correct" assert: "initial property values are correct"
@ -32,7 +31,7 @@
test(function() { test(function() {
declaration.cssText = "margin-left: 10px; padding-left: 10px;"; declaration.cssText = "margin-left: 10px; padding-left: 10px;";
assert_regexp_match(declaration.cssText, /margin-left: 10px;\s+padding-left: 10px;\s+/); assert_equals(declaration.cssText, "margin-left: 10px; padding-left: 10px;");
assert_equals(declaration.length, 2); assert_equals(declaration.length, 2);
assert_equals(declaration.item(0), "margin-left"); assert_equals(declaration.item(0), "margin-left");
assert_equals(declaration.item(1), "padding-left"); assert_equals(declaration.item(1), "padding-left");

View file

@ -57,7 +57,7 @@
assert_equals(mediaList.mediaText, "all, screen"); assert_equals(mediaList.mediaText, "all, screen");
}, "mediatest_medialist_serialize_comma", }, "mediatest_medialist_serialize_comma",
{ help: ["http://www.w3.org/TR/cssom-1/#the-medialist-interface", "http://www.w3.org/TR/cssom-1/#serializing-media-queries"], { help: ["http://www.w3.org/TR/cssom-1/#the-medialist-interface", "http://www.w3.org/TR/cssom-1/#serialize-a-media-query-list"],
assert: ["To serialize a comma-separated list concatenate all items of the list in list order while separating them by \",\" (U+002C), followed by a space (U+0020)."] }); assert: ["To serialize a comma-separated list concatenate all items of the list in list order while separating them by \",\" (U+002C), followed by a space (U+0020)."] });
test(function() { test(function() {
@ -75,11 +75,11 @@
mediaList.appendMedium('screen'); mediaList.appendMedium('screen');
mediaList.appendMedium('print'); mediaList.appendMedium('print');
assert_equals(mediaList.mediaText, "all, print, screen"); assert_equals(mediaList.mediaText, "all, screen, print");
}, "mediatest_medialist_serialize_lexicographical", }, "mediatest_medialist_serialize_order",
{ help: ["http://www.w3.org/TR/cssom-1/#the-medialist-interface", "http://www.w3.org/TR/cssom-1/#serializing-media-queries"], { help: ["http://www.w3.org/TR/cssom-1/#the-medialist-interface", "http://www.w3.org/TR/cssom-1/#serialize-a-media-query-list"],
assert: ["Each media query in the list of media queries should be sorted in lexicographical order."] }); assert: ["Each media query should be sorted in the same order as they appear in the list of media queries."] });
</script> </script>
</body> </body>

View file

@ -58,7 +58,7 @@
media_list.appendMedium("all"); media_list.appendMedium("all");
media_list.deleteMedium("screen"); assert_throws("NotFoundError", () => media_list.deleteMedium("screen"));
assert_equals(media_list.length, 1); assert_equals(media_list.length, 1);
assert_equals(media_list.item(0), "all"); assert_equals(media_list.item(0), "all");

View file

@ -55,7 +55,7 @@
assert_equals(media_list.length, 2); assert_equals(media_list.length, 2);
assert_equals(media_list.item(0), "screen"); assert_equals(media_list.item(0), "screen");
assert_equals(media_list.item(1), "all"); assert_equals(media_list.item(1), "all");
assert_equals(media_list.mediaText, "all, screen"); assert_equals(media_list.mediaText, "screen, all");
}, "appendMedium_correctly_appends_medium_to_nonempty_MediaList", }, "appendMedium_correctly_appends_medium_to_nonempty_MediaList",
{ assert: "MediaList.appendMedium correctly adds medium to a MediaList that already has a medium." }); { assert: "MediaList.appendMedium correctly adds medium to a MediaList that already has a medium." });

View file

@ -24,11 +24,11 @@
var styleSheet; var styleSheet;
var linkSheet; var linkSheet;
test(function() { test(function() {
assert_own_property(styleElement, "sheet"); assert_idl_attribute(styleElement, "sheet");
assert_readonly(styleElement, "sheet"); assert_readonly(styleElement, "sheet");
styleSheet = styleElement.sheet; styleSheet = styleElement.sheet;
assert_true(styleSheet instanceof CSSStyleSheet); assert_true(styleSheet instanceof CSSStyleSheet);
assert_own_property(linkElement, "sheet"); assert_idl_attribute(linkElement, "sheet");
linkSheet = linkElement.sheet; linkSheet = linkElement.sheet;
assert_true(linkSheet instanceof CSSStyleSheet); assert_true(linkSheet instanceof CSSStyleSheet);
}, "sheet_property", }, "sheet_property",
@ -48,8 +48,8 @@
assert: "The sheet property on LinkStyle should always return the current associated style sheet." }); assert: "The sheet property on LinkStyle should always return the current associated style sheet." });
test(function() { test(function() {
assert_own_property(styleSheet, "ownerRule"); assert_idl_attribute(styleSheet, "ownerRule");
assert_own_property(styleSheet, "cssRules"); assert_idl_attribute(styleSheet, "cssRules");
assert_inherits(styleSheet, "insertRule"); assert_inherits(styleSheet, "insertRule");
assert_inherits(styleSheet, "deleteRule"); assert_inherits(styleSheet, "deleteRule");
@ -71,13 +71,13 @@
assert: "CSSStyleSheet initial property values are correct" }); assert: "CSSStyleSheet initial property values are correct" });
test(function() { test(function() {
assert_own_property(styleSheet, "type"); assert_idl_attribute(styleSheet, "type");
assert_own_property(styleSheet, "disabled"); assert_idl_attribute(styleSheet, "disabled");
assert_own_property(styleSheet, "ownerNode"); assert_idl_attribute(styleSheet, "ownerNode");
assert_own_property(styleSheet, "parentStyleSheet"); assert_idl_attribute(styleSheet, "parentStyleSheet");
assert_own_property(styleSheet, "href"); assert_idl_attribute(styleSheet, "href");
assert_own_property(styleSheet, "title"); assert_idl_attribute(styleSheet, "title");
assert_own_property(styleSheet, "media"); assert_idl_attribute(styleSheet, "media");
assert_readonly(styleSheet, "type"); assert_readonly(styleSheet, "type");
assert_readonly(styleSheet, "ownerNode"); assert_readonly(styleSheet, "ownerNode");

View file

@ -11,56 +11,15 @@
<h1>idlharness test</h1> <h1>idlharness test</h1>
<p>This test validates the WebIDL included in the Encoding Living Standard.</p> <p>This test validates the WebIDL included in the Encoding Living Standard.</p>
<script type="text/plain" class="untested-idl">
interface Window {};
</script>
<script type="text/plain" class="idl">
// 8.1 Interface TextDecoder
dictionary TextDecoderOptions {
boolean fatal = false;
boolean ignoreBOM = false;
};
dictionary TextDecodeOptions {
boolean stream = false;
};
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
Exposed=(Window,Worker)]
interface TextDecoder {
readonly attribute DOMString encoding;
readonly attribute boolean fatal;
readonly attribute boolean ignoreBOM;
USVString decode(optional BufferSource input, optional TextDecodeOptions options);
};
// 8.2 Interface TextDecoder
[Constructor,
Exposed=(Window,Worker)]
interface TextEncoder {
readonly attribute DOMString encoding;
[NewObject] Uint8Array encode(optional USVString input = "");
};
</script>
<script> <script>
function select(selector) { promise_test(async() => {
return [].slice.call(document.querySelectorAll(selector)) const text = await (await fetch('/interfaces/encoding.idl')).text();
.map(function(e) { return e.textContent; }) const idl_array = new IdlArray();
.join('\n\n'); idl_array.add_idls(text);
} idl_array.add_objects({
TextEncoder: ['new TextEncoder()'],
var idl = select('.idl') TextDecoder: ['new TextDecoder()']
var untested = select('.untested-idl'); });
var idl_array = new IdlArray(); idl_array.test();
idl_array.add_untested_idls(untested); }, 'Test driver');
idl_array.add_idls(idl);
idl_array.add_objects({
TextEncoder: ['new TextEncoder()'],
TextDecoder: ['new TextDecoder()']
});
idl_array.test();
</script> </script>

View file

@ -32,7 +32,7 @@ function redirectLocation(desc, redirectUrl, redirectLocation, redirectStatus, r
var redirUrl = RESOURCES_DIR + "redirect.py"; var redirUrl = RESOURCES_DIR + "redirect.py";
var locationUrl = "top.txt"; var locationUrl = "top.txt";
var invalidLocationUrl = "#invalidurl:"; var invalidLocationUrl = "invalidurl:";
var dataLocationUrl = "data:,data%20url"; var dataLocationUrl = "data:,data%20url";
// FIXME: We may want to mix redirect-mode and cors-mode. // FIXME: We may want to mix redirect-mode and cors-mode.
// FIXME: Add tests for "error" redirect-mode. // FIXME: Add tests for "error" redirect-mode.

View file

@ -0,0 +1,24 @@
dictionary TextDecoderOptions {
boolean fatal = false;
boolean ignoreBOM = false;
};
dictionary TextDecodeOptions {
boolean stream = false;
};
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
Exposed=(Window,Worker)]
interface TextDecoder {
readonly attribute DOMString encoding;
readonly attribute boolean fatal;
readonly attribute boolean ignoreBOM;
USVString decode(optional BufferSource input, optional TextDecodeOptions options);
};
[Constructor,
Exposed=(Window,Worker)]
interface TextEncoder {
readonly attribute DOMString encoding;
[NewObject] Uint8Array encode(optional USVString input = "");
};

View file

@ -6,10 +6,10 @@ interface Magnetometer : Sensor {
readonly attribute double? z; readonly attribute double? z;
}; };
enum LocalCoordinateSystem { "device", "screen" }; enum MagnetometerLocalCoordinateSystem { "device", "screen" };
dictionary MagnetometerSensorOptions : SensorOptions { dictionary MagnetometerSensorOptions : SensorOptions {
LocalCoordinateSystem referenceFrame = "device"; MagnetometerLocalCoordinateSystem referenceFrame = "device";
}; };
[Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext, [Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext,

View file

@ -6,10 +6,10 @@ interface OrientationSensor : Sensor {
void populateMatrix(RotationMatrixType targetMatrix); void populateMatrix(RotationMatrixType targetMatrix);
}; };
enum LocalCoordinateSystem { "device", "screen" }; enum OrientationSensorLocalCoordinateSystem { "device", "screen" };
dictionary OrientationSensorOptions : SensorOptions { dictionary OrientationSensorOptions : SensorOptions {
LocalCoordinateSystem referenceFrame = "device"; OrientationSensorLocalCoordinateSystem referenceFrame = "device";
}; };
[Constructor(optional OrientationSensorOptions sensorOptions), SecureContext, Exposed=Window] [Constructor(optional OrientationSensorOptions sensorOptions), SecureContext, Exposed=Window]

View file

@ -0,0 +1,95 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test for PaymentRequest.abort() method</title>
<link rel="help" href="https://w3c.github.io/browser-payment-api/#abort-method">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
setup({
// Ignore unhandled rejections resulting from .show()'s acceptPromise
// not being explicitly handled.
allow_uncaught_exception: true,
explicit_done: true,
explicit_timeout: true,
});
const basicCard = Object.freeze({ supportedMethods: "basic-card" });
const defaultMethods = Object.freeze([basicCard]);
const defaultDetails = Object.freeze({
total: {
label: "Total",
amount: {
currency: "USD",
value: "1.00",
},
},
});
promise_test(async t => {
// request is in "created" state
const request = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects(t, "InvalidStateError", request.abort());
}, `Throws if the promise [[state]] is not "interactive"`);
function manualTest1(elem){
elem.disabled = true;
promise_test(async t => {
// request is in "created" state.
const request = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects(t, "InvalidStateError", request.abort());
// Call it again, for good measure.
await promise_rejects(t, "InvalidStateError", request.abort());
// The request's state is "created", so let's show it
// which changes the state to "interactive.".
const acceptPromise = request.show();
// Let's set request the state to "closed" by calling .abort()
try {
await request.abort();
} catch (err) {
assert_unreached("Unexpected promise rejection: " + err.message);
}
// The request is now "closed", so...
await promise_rejects(t, "InvalidStateError", request.abort());
await promise_rejects(t, "AbortError", acceptPromise);
}, elem.textContent.trim());
}
function manualTest2(elem){
elem.disabled = true;
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show();
try {
await request.abort();
} catch (err) {
assert_unreached("Unexpected promise rejection: " + err.message);
}
await promise_rejects(t, "AbortError", acceptPromise);
// As request is now "closed", trying to show it will fail
await promise_rejects(t, "InvalidStateError", request.show());
}, elem.textContent.trim());
done();
}
</script>
<h2>Test for PaymentRequest.abort() method</h2>
<p>
Click on each button in sequence from top to bottom without refreshing the page.
No payment sheet will be shown, but the tests will run in the background.
</p>
<ol>
<li>
<button onclick="manualTest1(this)">
Calling abort must not change the [[state]] until after "interactive".
</button>
</li>
<li>
<button onclick="manualTest2(this)">
Calling .abort() causes acceptPromise to reject and closes the request.
</button>
</li>
</ol>
<small>
If you find a buggy test, please <a href="https://github.com/w3c/web-platform-tests/issues">file a bug</a>
and tag one of the <a href="https://github.com/w3c/web-platform-tests/blob/master/payment-request/OWNERS">owners</a>.
</small>

View file

@ -1,65 +0,0 @@
<!DOCTYPE html>
<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
<meta charset="utf-8">
<title>Test for PaymentRequest.abort() method</title>
<link rel="help" href="https://w3c.github.io/browser-payment-api/#abort-method">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
setup(() => {}, {
// Ignore unhandled rejections resulting from .show()'s acceptPromise
// not being explicitly handled.
allow_uncaught_exception: true,
});
const basicCard = Object.freeze({ supportedMethods: "basic-card" });
const defaultMethods = Object.freeze([basicCard]);
const defaultDetails = Object.freeze({
total: {
label: "Total",
amount: {
currency: "USD",
value: "1.00",
},
},
});
promise_test(async t => {
// request is in "created" state
const request = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects(t, "InvalidStateError", request.abort());
}, `Throws if the promise [[state]] is not "interactive"`);
promise_test(async t => {
// request is in "created" state.
const request = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects(t, "InvalidStateError", request.abort());
// Call it again, for good measure.
await promise_rejects(t, "InvalidStateError", request.abort());
// The request's state is "created", so let's show it
// which changes the state to "interactive.".
request.show();
// Let's set request the state to "closed" by calling .abort()
try {
await request.abort();
} catch (err) {
assert_unreached("Unexpected promise rejection: " + err.message);
}
// The request is now "closed", so...
await promise_rejects(t, "InvalidStateError", request.abort());
}, `Calling abort must not change the [[state]] until after "interactive"`);
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show();
try {
await request.abort();
} catch (err) {
assert_unreached("Unexpected promise rejection: " + err.message);
}
await promise_rejects(t, "AbortError", acceptPromise);
// As request is now "closed", trying to show it will fail
await promise_rejects(t, "InvalidStateError", request.show());
}, "calling .abort() causes acceptPromise to reject and closes the request.");
</script>

View file

@ -1,11 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
<meta charset="utf-8"> <meta charset="utf-8">
<title>Tests for PaymentRequest.canMakePayment() method</title> <title>Tests for PaymentRequest.canMakePayment() method</title>
<link rel="help" href="https://w3c.github.io/browser-payment-api/#show-method"> <link rel="help" href="https://w3c.github.io/browser-payment-api/#show-method">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script> <script>
setup({
explicit_done: true,
explicit_timeout: true,
});
const basicCard = Object.freeze({ supportedMethods: "basic-card" }); const basicCard = Object.freeze({ supportedMethods: "basic-card" });
const defaultMethods = Object.freeze([basicCard]); const defaultMethods = Object.freeze([basicCard]);
const defaultDetails = Object.freeze({ const defaultDetails = Object.freeze({
@ -38,47 +42,6 @@ promise_test(async t => {
} }
}, `If request.[[state]] is "created", then return a promise that resolves to true for known method.`); }, `If request.[[state]] is "created", then return a promise that resolves to true for known method.`);
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show(); // Sets state to "interactive"
const canMakePaymentPromise = request.canMakePayment();
try {
const result = await canMakePaymentPromise;
assert_true(
false,
`canMakePaymentPromise should have thrown InvalidStateError`
);
} catch (err) {
await promise_rejects(t, "InvalidStateError", canMakePaymentPromise);
} finally {
await request.abort();
await promise_rejects(t, "AbortError", acceptPromise);
}
// The state should be "closed"
await promise_rejects(t, "InvalidStateError", request.canMakePayment());
}, `If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException.`);
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show(); // The state is now "interactive"
acceptPromise.catch(() => {}); // no-op, just to silence unhandled rejection in devtools.
await request.abort(); // The state is now "closed"
await promise_rejects(t, "InvalidStateError", request.canMakePayment());
try {
const result = await request.canMakePayment();
assert_true(
false,
`should have thrown InvalidStateError, but instead returned "${result}"`
);
} catch (err) {
assert_equals(
err.name,
"InvalidStateError",
"must be an InvalidStateError."
);
}
}, `If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException.`);
promise_test(async t => { promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails); const request = new PaymentRequest(defaultMethods, defaultDetails);
assert_true(await request.canMakePayment(), "basic-card should be supported"); assert_true(await request.canMakePayment(), "basic-card should be supported");
@ -160,4 +123,74 @@ promise_test(async t => {
} }
} }
}, `Optionally, at the user agent's discretion, return a promise rejected with a "NotAllowedError" DOMException.`); }, `Optionally, at the user agent's discretion, return a promise rejected with a "NotAllowedError" DOMException.`);
function manualTest1(elem){
elem.disabled = true;
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show(); // Sets state to "interactive"
const canMakePaymentPromise = request.canMakePayment();
try {
const result = await canMakePaymentPromise;
assert_true(
false,
`canMakePaymentPromise should have thrown InvalidStateError`
);
} catch (err) {
await promise_rejects(t, "InvalidStateError", canMakePaymentPromise);
} finally {
await request.abort();
await promise_rejects(t, "AbortError", acceptPromise);
}
// The state should be "closed"
await promise_rejects(t, "InvalidStateError", request.canMakePayment());
}, elem.textContent.trim());
}
function manualTest2(elem){
elem.disabled = true;
promise_test(async t => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show(); // The state is now "interactive"
acceptPromise.catch(() => {}); // no-op, just to silence unhandled rejection in devtools.
await request.abort(); // The state is now "closed"
await promise_rejects(t, "InvalidStateError", request.canMakePayment());
try {
const result = await request.canMakePayment();
assert_true(
false,
`should have thrown InvalidStateError, but instead returned "${result}"`
);
} catch (err) {
assert_equals(
err.name,
"InvalidStateError",
"must be an InvalidStateError."
);
}
}, elem.textContent.trim());
done();
}
</script> </script>
<h2>Tests for PaymentRequest.canMakePayment() method</h2>
<p>
Click on each button in sequence from top to bottom without refreshing the page.
No payment sheet will be shown, but the tests will run in the background.
</p>
<ol>
<li>
<button onclick="manualTest1(this)">
If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException.
</button>
</li>
<li>
<button onclick="manualTest2(this)">
If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException.
</button>
</li>
</ol>
<small>
If you find a buggy test, please <a href="https://github.com/w3c/web-platform-tests/issues">file a bug</a>
and tag one of the <a href="https://github.com/w3c/web-platform-tests/blob/master/payment-request/OWNERS">owners</a>.
</small>

View file

@ -0,0 +1,6 @@
<!doctype html>
<title></title>
<script>
var timeout_multiplier = 1;
var win = null;
</script>

View file

@ -0,0 +1,26 @@
[run]
branch = True
parallel = True
omit =
html5lib/*
py/*
pytest/*
pywebsocket/*
six/*
webdriver/*
wptserve/*
*/site-packages/*
*/lib_pypy/*
[paths]
html5lib =
html5lib/html5lib
.tox/**/site-packages/html5lib
pytest =
pytest/_pytest
.tox/**/site-packages/_pytest
py =
py/py
.tox/**/site-packages/py

View file

@ -1,5 +1,6 @@
*# *#
.coverage* .coverage
.coverage.*
htmlcov/ htmlcov/
coverage.xml coverage.xml
.tox/ .tox/

View file

@ -9,7 +9,6 @@ import os
import re import re
import subprocess import subprocess
import sys import sys
import tempfile
from collections import defaultdict from collections import defaultdict
@ -135,28 +134,6 @@ def check_ahem_copy(repo_root, path):
return [] return []
def check_git_ignore(repo_root, paths):
errors = []
with tempfile.TemporaryFile('w+') as f:
f.write('\n'.join(paths))
f.seek(0)
try:
matches = subprocess.check_output(
["git", "check-ignore", "--verbose", "--no-index", "--stdin"], stdin=f)
for match in matches.strip().split('\n'):
match_filter, path = match.split()
_, _, filter_string = match_filter.split(':')
# If the matching filter reported by check-ignore is a special-case exception,
# that's fine. Otherwise, it requires a new special-case exception.
if filter_string != '!' + path:
errors += [("IGNORED PATH", "%s matches an ignore filter in .gitignore - "
"please add a .gitignore exception" % path, path, None)]
except subprocess.CalledProcessError as e:
# Nonzero return code means that no match exists.
pass
return errors
drafts_csswg_re = re.compile(r"https?\:\/\/drafts\.csswg\.org\/([^/?#]+)") drafts_csswg_re = re.compile(r"https?\:\/\/drafts\.csswg\.org\/([^/?#]+)")
w3c_tr_re = re.compile(r"https?\:\/\/www\.w3c?\.org\/TR\/([^/?#]+)") w3c_tr_re = re.compile(r"https?\:\/\/www\.w3c?\.org\/TR\/([^/?#]+)")
w3c_dev_re = re.compile(r"https?\:\/\/dev\.w3c?\.org\/[^/?#]+\/([^/?#]+)") w3c_dev_re = re.compile(r"https?\:\/\/dev\.w3c?\.org\/[^/?#]+\/([^/?#]+)")
@ -301,9 +278,7 @@ def filter_whitelist_errors(data, errors):
for i, (error_type, msg, path, line) in enumerate(errors): for i, (error_type, msg, path, line) in enumerate(errors):
normpath = os.path.normcase(path) normpath = os.path.normcase(path)
# Allow whitelisting all lint errors except the IGNORED PATH lint, if error_type in data:
# which explains how to fix it correctly and shouldn't be ignored.
if error_type in data and error_type != "IGNORED PATH":
wl_files = data[error_type] wl_files = data[error_type]
for file_match, allowed_lines in iteritems(wl_files): for file_match, allowed_lines in iteritems(wl_files):
if None in allowed_lines or line in allowed_lines: if None in allowed_lines or line in allowed_lines:
@ -865,13 +840,6 @@ path_lints = [check_path_length, check_worker_collision, check_ahem_copy]
all_paths_lints = [check_css_globally_unique] all_paths_lints = [check_css_globally_unique]
file_lints = [check_regexp_line, check_parsed, check_python_ast, check_script_metadata] file_lints = [check_regexp_line, check_parsed, check_python_ast, check_script_metadata]
# Don't break users of the lint that don't have git installed.
try:
subprocess.check_output(["git", "--version"])
all_paths_lints += [check_git_ignore]
except subprocess.CalledProcessError:
print('No git present; skipping .gitignore lint.')
if __name__ == "__main__": if __name__ == "__main__":
args = create_parser().parse_args() args = create_parser().parse_args()
error_count = main(**vars(args)) error_count = main(**vars(args))

View file

@ -0,0 +1,6 @@
[run]
source=funcsigs
omit=funcsigs/odict*
[report]
include=funcsigs*

View file

@ -0,0 +1,4 @@
[run]
omit =
# standlonetemplate is read dynamically and tested by test_genscript
*standalonetemplate.py

View file

@ -0,0 +1,11 @@
[run]
branch = True
parallel = True
omit =
*/site-packages/*
*/lib_pypy/*
[paths]
wptserve =
wptserve
.tox/**/site-packages/wptserve

View file

@ -11,6 +11,39 @@
<script> <script>
'use strict'; 'use strict';
test(t => {
const anim = new Animation();
assert_equals(anim.playState, 'idle');
assert_equals(anim.currentTime, null);
// This should not throw because the currentTime is already null.
anim.currentTime = null;
}, 'Setting the current time of a pending animation to unresolved does not'
+ ' throw a TypeError');
promise_test(async t => {
const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
await anim.ready;
assert_greater_than_equal(anim.currentTime, 0);
assert_throws({ name: 'TypeError' }, () => {
anim.currentTime = null;
});
}, 'Setting the current time of a playing animation to unresolved throws a'
+ ' TypeError');
promise_test(async t => {
const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
await anim.ready;
anim.pause();
assert_greater_than_equal(anim.currentTime, 0);
assert_throws({ name: 'TypeError' }, () => {
anim.currentTime = null;
});
}, 'Setting the current time of a paused animation to unresolved throws a'
+ ' TypeError');
promise_test(async t => { promise_test(async t => {
const anim = createDiv(t).animate(null, 100 * MS_PER_SEC); const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
await anim.ready; await anim.ready;