mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 3488a5a845bec08943f66974e9f0df4ffe96774a
This commit is contained in:
parent
0d142bea9a
commit
cc9937a2b0
26 changed files with 302 additions and 147 deletions
|
@ -134637,6 +134637,18 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"css/css-multicol/change-intrinsic-width.html": [
|
||||||
|
[
|
||||||
|
"css/css-multicol/change-intrinsic-width.html",
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"/css/reference/ref-filled-green-100px-square.xht",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"css/css-multicol/column-count-used-001.html": [
|
"css/css-multicol/column-count-used-001.html": [
|
||||||
[
|
[
|
||||||
"css/css-multicol/column-count-used-001.html",
|
"css/css-multicol/column-count-used-001.html",
|
||||||
|
@ -338168,6 +338180,12 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"css/cssom-view/getClientRects-inline-inline-child.html": [
|
||||||
|
[
|
||||||
|
"css/cssom-view/getClientRects-inline-inline-child.html",
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"css/cssom-view/historical.html": [
|
"css/cssom-view/historical.html": [
|
||||||
[
|
[
|
||||||
"css/cssom-view/historical.html",
|
"css/cssom-view/historical.html",
|
||||||
|
@ -588279,6 +588297,10 @@
|
||||||
"434dc52ea3d731bd1393270372294cd007382e59",
|
"434dc52ea3d731bd1393270372294cd007382e59",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
|
"css/css-multicol/change-intrinsic-width.html": [
|
||||||
|
"3df3e1ebc8f9b5780dc858a878bca13dbedcdb35",
|
||||||
|
"reftest"
|
||||||
|
],
|
||||||
"css/css-multicol/column-count-used-001.html": [
|
"css/css-multicol/column-count-used-001.html": [
|
||||||
"2949a1996ebae0c48329906ea7ef34c83080e90f",
|
"2949a1996ebae0c48329906ea7ef34c83080e90f",
|
||||||
"reftest"
|
"reftest"
|
||||||
|
@ -625603,6 +625625,10 @@
|
||||||
"f1f6fc5abc679d087d221573456eb9219d1a405c",
|
"f1f6fc5abc679d087d221573456eb9219d1a405c",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
|
"css/cssom-view/getClientRects-inline-inline-child.html": [
|
||||||
|
"9a03ccdbccc80d8a0ce6f701aeaa802b1b4715e4",
|
||||||
|
"testharness"
|
||||||
|
],
|
||||||
"css/cssom-view/getClientRects-inline.html": [
|
"css/cssom-view/getClientRects-inline.html": [
|
||||||
"415e34a6f0430e08441ee32b3f7c0ca8cd11a692",
|
"415e34a6f0430e08441ee32b3f7c0ca8cd11a692",
|
||||||
"reftest"
|
"reftest"
|
||||||
|
@ -664512,11 +664538,11 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"html/semantics/forms/constraints/form-validation-validity-valid.html": [
|
"html/semantics/forms/constraints/form-validation-validity-valid.html": [
|
||||||
"cec5dcbf0d5cfb340e100a82e723e1d620d16399",
|
"03655ffd2f5ba24b30e6864c8393ecbf36230aef",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"html/semantics/forms/constraints/form-validation-validity-valueMissing.html": [
|
"html/semantics/forms/constraints/form-validation-validity-valueMissing.html": [
|
||||||
"3c9e4c4cb096bbe93b540c3f704d0d116a055aba",
|
"2e1c666436a19bc759026ebf55df4a17073ecb5d",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"html/semantics/forms/constraints/form-validation-willValidate.html": [
|
"html/semantics/forms/constraints/form-validation-willValidate.html": [
|
||||||
|
@ -664532,7 +664558,7 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"html/semantics/forms/constraints/support/validator.js": [
|
"html/semantics/forms/constraints/support/validator.js": [
|
||||||
"48c3a5b40e6bbe06b18dde7f473188a827b7de6a",
|
"33508fb3289be3736f6f467957dc6614bec2bc9b",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"html/semantics/forms/constraints/tooLong-input-email-delete-manual.html": [
|
"html/semantics/forms/constraints/tooLong-input-email-delete-manual.html": [
|
||||||
|
@ -701572,7 +701598,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"resources/chromium/nfc-mock.js": [
|
"resources/chromium/nfc-mock.js": [
|
||||||
"4bafc9b0ad8f7f8ad4185914fffef16949695ab3",
|
"2c1724b7592eb1d6e66177544998abbec70fbfe6",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"resources/chromium/sensor.mojom.js": [
|
"resources/chromium/sensor.mojom.js": [
|
||||||
|
@ -717860,7 +717886,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/browsers/firefox_android.py": [
|
"tools/wptrunner/wptrunner/browsers/firefox_android.py": [
|
||||||
"33b5d51e54e82adb6cdbe4612263bc30883dd108",
|
"fee528071f68843ab056f513295146685f8f78f4",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/browsers/ie.py": [
|
"tools/wptrunner/wptrunner/browsers/ie.py": [
|
||||||
|
@ -717936,7 +717962,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/executors/executormarionette.py": [
|
"tools/wptrunner/wptrunner/executors/executormarionette.py": [
|
||||||
"59f7e865a5b8711fa71c9c8955eca731e0048c3f",
|
"01306397db7944cd0dfadf8f1bf0327dbacf94d6",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/executors/executoropera.py": [
|
"tools/wptrunner/wptrunner/executors/executoropera.py": [
|
||||||
|
@ -717992,7 +718018,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/executors/test-wait.js": [
|
"tools/wptrunner/wptrunner/executors/test-wait.js": [
|
||||||
"8a7edb79d62256eef63c71eabd450d42bce7c4d2",
|
"ad08ad7d76fb0299aadedb572193c38c5055e654",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/executors/testharness_servodriver.js": [
|
"tools/wptrunner/wptrunner/executors/testharness_servodriver.js": [
|
||||||
|
@ -718012,7 +718038,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/font.py": [
|
"tools/wptrunner/wptrunner/font.py": [
|
||||||
"6647a8580be7ab4050bbd37593b2e6595bc3ac72",
|
"daf0a1c1bfa221aa47981d93239021e4aefa74a9",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/formatters/__init__.py": [
|
"tools/wptrunner/wptrunner/formatters/__init__.py": [
|
||||||
|
@ -718244,7 +718270,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/wptrunner.py": [
|
"tools/wptrunner/wptrunner/wptrunner.py": [
|
||||||
"7409dc26560af0be3a397bb73184137d8715811f",
|
"75ce104c7cee335afa2e86592caa2c4caa473bcf",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"tools/wptrunner/wptrunner/wpttest.py": [
|
"tools/wptrunner/wptrunner/wpttest.py": [
|
||||||
|
@ -724608,7 +724634,7 @@
|
||||||
"manual"
|
"manual"
|
||||||
],
|
],
|
||||||
"web-nfc/NDEFReader_scan.https.html": [
|
"web-nfc/NDEFReader_scan.https.html": [
|
||||||
"a9b1d7516173418243c630817eea22fd0bed2046",
|
"17b9fdb8569db230c3a3ded22e0258e4f73a69fc",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"web-nfc/NDEFReader_scan_filter.https.html": [
|
"web-nfc/NDEFReader_scan_filter.https.html": [
|
||||||
|
@ -724632,7 +724658,7 @@
|
||||||
"manual"
|
"manual"
|
||||||
],
|
],
|
||||||
"web-nfc/NDEFWriter_push.https.html": [
|
"web-nfc/NDEFWriter_push.https.html": [
|
||||||
"4ff0af8fb0b3947595bdf48015ebabce165003ba",
|
"cb6b3941410035c5c5736e13d59fbbfb85f0d4cc",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"web-nfc/README.md": [
|
"web-nfc/README.md": [
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[elementFromPoint-001.html]
|
||||||
|
[CSSOM View - 5 - extensions to the Document interface]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[getClientRects-inline-inline-child.html]
|
||||||
|
[sub element in a child inline box should not be included]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -309,9 +309,6 @@
|
||||||
[<iframe>: separate response Content-Type: */* text/html]
|
[<iframe>: separate response Content-Type: */* text/html]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[<iframe>: separate response Content-Type: text/html;" text/plain]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
|
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -324,15 +321,15 @@
|
||||||
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
|
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[<iframe>: combined response Content-Type: text/html */*]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[fetch(): separate response Content-Type: text/plain ]
|
[fetch(): separate response Content-Type: text/plain ]
|
||||||
expected: NOTRUN
|
expected: NOTRUN
|
||||||
|
|
||||||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
[<iframe>: combined response Content-Type: */* text/html]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
|
[<iframe>: separate response Content-Type: text/html */*]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
[X-Content-Type-Options%3A%20nosniff%0C]
|
[X-Content-Type-Options%3A%20nosniff%0C]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[X-Content-Type-Options%3A%20'NosniFF']
|
[X-Content-Type-Options%3A%20%2Cnosniff]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,11 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Embedded credentials are treated as network errors in new windows.]
|
[Embedded credentials are treated as network errors in new windows.]
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[Embedded credentials matching the top-level are treated as network errors for cross-origin URLs.]
|
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[Embedded credentials matching the top-level are treated as network errors for cross-origin URLs.]
|
||||||
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
[Embedded credentials matching the top-level are not treated as network errors for relative URLs.]
|
||||||
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[traverse_the_history_2.html]
|
[traverse_the_history_3.html]
|
||||||
[Multiple history traversals, last would be aborted]
|
[Multiple history traversals, last would be aborted]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[creating_browsing_context_test_01.html]
|
||||||
|
[first argument: absolute url]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
[skip-document-with-fragment.html]
|
[skip-document-with-fragment.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[Autofocus elements in iframed documents with URL fragments should be skipped.]
|
[Autofocus elements in iframed documents with URL fragments should be skipped.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Autofocus elements in top-level browsing context's documents with URI fragments should be skipped.]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[iframe_sandbox_popups_escaping-3.html]
|
[iframe_sandbox_popups_escaping-3.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,3 @@
|
||||||
[Verifies the resolution of entry.startTime is at least 20 microseconds.]
|
[Verifies the resolution of entry.startTime is at least 20 microseconds.]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
[Verifies the resolution of performance.now() is at least 5 microseconds.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[crossorigin-sandwich-TAO.sub.html]
|
[crossorigin-sandwich-TAO.sub.html]
|
||||||
expected: ERROR
|
|
||||||
[There should be one entry.]
|
[There should be one entry.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[005.html]
|
[005.html]
|
||||||
expected: ERROR
|
|
||||||
[dedicated worker in shared worker in dedicated worker]
|
[dedicated worker in shared worker in dedicated worker]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||||
|
<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#pseudo-algorithm">
|
||||||
|
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1037790">
|
||||||
|
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||||
|
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||||
|
<div style="columns:2; column-fill:auto; column-gap:0; width:fit-content; height:100px; background:red;">
|
||||||
|
<div id="firstChild" style="width:200px; height:100px; background:green;"></div>
|
||||||
|
<div style="width:50px; height:100px; background:green;"></div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.body.offsetTop;
|
||||||
|
firstChild.style.width = "50px";
|
||||||
|
</script>
|
|
@ -0,0 +1,52 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
|
||||||
|
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<span>test</span>
|
||||||
|
<span id="vertical-align-sub-as-grand-child"
|
||||||
|
title="sub element in a child inline box should not be included">
|
||||||
|
<span>
|
||||||
|
<sub class="not-include" style="vertical-align: sub">subscript</sub>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span>test</span>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
testTargetDoesNotInclude('vertical-align-sub-as-grand-child');
|
||||||
|
|
||||||
|
function testTargetDoesNotInclude(target) {
|
||||||
|
target = document.getElementById(target);
|
||||||
|
test(() => {
|
||||||
|
let target_rects = target.getClientRects();
|
||||||
|
|
||||||
|
let not_include_rects = [];
|
||||||
|
for (let element of target.querySelectorAll('.not-include')) {
|
||||||
|
for (let rect of element.getClientRects())
|
||||||
|
not_include_rects.push(rect);
|
||||||
|
}
|
||||||
|
for (let rect of target_rects) {
|
||||||
|
for (let not_include_rect of not_include_rects) {
|
||||||
|
assert_rect_not_equals(rect, not_include_rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, target.title);
|
||||||
|
}
|
||||||
|
|
||||||
|
function assert_rect_not_equals(rect1, rect2) {
|
||||||
|
assert_false(rectEquals(rect1, rect2),
|
||||||
|
`${rectToString(rect1)} and ${rectToString(rect2)} are not equal`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function rectEquals(rect1, rect2) {
|
||||||
|
return rect1.x === rect2.x && rect1.y === rect2.y &&
|
||||||
|
rect1.width === rect2.width && rect1.height === rect2.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
function rectToString(rect) {
|
||||||
|
return `{${rect.x}, ${rect.y} ${rect.width}x${rect.height}}`;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
|
@ -15,7 +15,7 @@
|
||||||
types: ["text", "search", "tel", "password"],
|
types: ["text", "search", "tel", "password"],
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
{conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
{conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||||
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
{conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
|
||||||
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
{conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
||||||
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
{conditions: {max: "2000-01-01", value: "2001-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
{conditions: {max: "2000-01-01", value: "2001-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
||||||
{conditions: {min: "2001-01-01", value: "2000-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "2001-01-01", value: "2000-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
{conditions: {step: 2 * 1 * 86400000, value: "2000-01-03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 2 * 1 * 86400000, value: "2000-01-03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
// Step checks that "months since Jan 1970" is evenly divisible by `step`
|
// Step checks that "months since Jan 1970" is evenly divisible by `step`
|
||||||
{conditions: {step: 3, value: "2001-02"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 3, value: "2001-02"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
{conditions: {max: "2000-W01", value: "2001-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
{conditions: {max: "2000-W01", value: "2001-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
||||||
{conditions: {min: "2001-W01", value: "2000-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "2001-W01", value: "2000-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
{conditions: {step: 2 * 1 * 604800000, value: "2001-W03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 2 * 1 * 604800000, value: "2001-W03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
{conditions: {max: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
{conditions: {max: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
||||||
{conditions: {min: "12:00:00", value: "11:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "12:00:00", value: "11:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
{conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
{conditions: {max: "5", value: "6"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
{conditions: {max: "5", value: "6"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
|
||||||
{conditions: {min: "5", value: "4"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
{conditions: {min: "5", value: "4"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
|
||||||
{conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
{conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
tag: "textarea",
|
tag: "textarea",
|
||||||
types: [],
|
types: [],
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
{conditions: {required: true, value: ""}, expected: false, expectedImmutable: true, name: "[target] validity.valid must be false if validity.valueMissing is true"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
||||||
{conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty and required is true"},
|
{conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty and required is true"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value is empty and required is true"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value is empty and required is true"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -27,13 +27,13 @@
|
||||||
{conditions: {required: true, value: "2000-12-10T12:00:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10T12:00:00)"},
|
{conditions: {required: true, value: "2000-12-10T12:00:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10T12:00:00)"},
|
||||||
{conditions: {required: true, value: "2000-12-10 12:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10 12:00)"},
|
{conditions: {required: true, value: "2000-12-10 12:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10 12:00)"},
|
||||||
{conditions: {required: true, value: "1979-10-14T12:00:00.001"}, expected: false, name: "[target] Valid local date and time string(1979-10-14T12:00:00.001)"},
|
{conditions: {required: true, value: "1979-10-14T12:00:00.001"}, expected: false, name: "[target] Valid local date and time string(1979-10-14T12:00:00.001)"},
|
||||||
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
|
{conditions: {required: true, value: 1234567}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a number(1234567)"},
|
||||||
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
|
{conditions: {required: true, value: new Date()}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a Date object"},
|
||||||
{conditions: {required: true, value: "1979-10-99 99:99"}, expected: true, name: "[target] Invalid local date and time string(1979-10-99 99:99)"},
|
{conditions: {required: true, value: "1979-10-99 99:99"}, expected: true, expectedImmutable: false, name: "[target] Invalid local date and time string(1979-10-99 99:99)"},
|
||||||
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: false, name: "[target] Valid local date and time string(1979-10-14 12:00:00)"},
|
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: false, name: "[target] Valid local date and time string(1979-10-14 12:00:00)"},
|
||||||
{conditions: {required: true, value: "2001-12-21 12:00"}, expected: true, name: "[target] Invalid local date and time string(2001-12-21 12:00)-two white space"},
|
{conditions: {required: true, value: "2001-12-21 12:00"}, expected: true, expectedImmutable: false, name: "[target] Invalid local date and time string(2001-12-21 12:00)-two white space"},
|
||||||
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] the value attribute is a string(abc)"},
|
{conditions: {required: true, value: "abc"}, expected: true, expectedImmutable: false, name: "[target] the value attribute is a string(abc)"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -43,12 +43,12 @@
|
||||||
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
||||||
{conditions: {required: true, value: "2000-12-10"}, expected: false, name: "[target] Valid date string(2000-12-10)"},
|
{conditions: {required: true, value: "2000-12-10"}, expected: false, name: "[target] Valid date string(2000-12-10)"},
|
||||||
{conditions: {required: true, value: "9999-01-01"}, expected: false, name: "[target] Valid date string(9999-01-01)"},
|
{conditions: {required: true, value: "9999-01-01"}, expected: false, name: "[target] Valid date string(9999-01-01)"},
|
||||||
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
|
{conditions: {required: true, value: 1234567}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a number(1234567)"},
|
||||||
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
|
{conditions: {required: true, value: new Date()}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a Date object"},
|
||||||
{conditions: {required: true, value: "9999-99-99"}, expected: true, name: "[target] Invalid date string(9999-99-99)"},
|
{conditions: {required: true, value: "9999-99-99"}, expected: true, expectedImmutable: false, name: "[target] Invalid date string(9999-99-99)"},
|
||||||
{conditions: {required: true, value: "37/01/01"}, expected: true, name: "[target] Invalid date string(37-01-01)"},
|
{conditions: {required: true, value: "37/01/01"}, expected: true, expectedImmutable: false, name: "[target] Invalid date string(37-01-01)"},
|
||||||
{conditions: {required: true, value: "2000/01/01"}, expected: true, name: "[target] Invalid date string(2000/01/01)"},
|
{conditions: {required: true, value: "2000/01/01"}, expected: true, expectedImmutable: false, name: "[target] Invalid date string(2000/01/01)"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -58,12 +58,12 @@
|
||||||
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
||||||
{conditions: {required: true, value: "2000-12"}, expected: false, name: "[target] Valid month string(2000-12)"},
|
{conditions: {required: true, value: "2000-12"}, expected: false, name: "[target] Valid month string(2000-12)"},
|
||||||
{conditions: {required: true, value: "9999-01"}, expected: false, name: "[target] Valid month string(9999-01)"},
|
{conditions: {required: true, value: "9999-01"}, expected: false, name: "[target] Valid month string(9999-01)"},
|
||||||
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
|
{conditions: {required: true, value: 1234567}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a number(1234567)"},
|
||||||
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
|
{conditions: {required: true, value: new Date()}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a Date object"},
|
||||||
{conditions: {required: true, value: "2000-99"}, expected: true, name: "[target] Invalid month string(2000-99)"},
|
{conditions: {required: true, value: "2000-99"}, expected: true, expectedImmutable: false, name: "[target] Invalid month string(2000-99)"},
|
||||||
{conditions: {required: true, value: "37-01"}, expected: true, name: "[target] Invalid month string(37-01)"},
|
{conditions: {required: true, value: "37-01"}, expected: true, expectedImmutable: false, name: "[target] Invalid month string(37-01)"},
|
||||||
{conditions: {required: true, value: "2000/01"}, expected: true, name: "[target] Invalid month string(2000/01)"},
|
{conditions: {required: true, value: "2000/01"}, expected: true, expectedImmutable: false, name: "[target] Invalid month string(2000/01)"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -73,12 +73,12 @@
|
||||||
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
||||||
{conditions: {required: true, value: "2000-W12"}, expected: false, name: "[target] Valid week string(2000-W12)"},
|
{conditions: {required: true, value: "2000-W12"}, expected: false, name: "[target] Valid week string(2000-W12)"},
|
||||||
{conditions: {required: true, value: "9999-W01"}, expected: false, name: "[target] Valid week string(9999-W01)"},
|
{conditions: {required: true, value: "9999-W01"}, expected: false, name: "[target] Valid week string(9999-W01)"},
|
||||||
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
|
{conditions: {required: true, value: 1234567}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a number(1234567)"},
|
||||||
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
|
{conditions: {required: true, value: new Date()}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a Date object"},
|
||||||
{conditions: {required: true, value: "2000-W99"}, expected: true, name: "[target] Invalid week string(2000-W99)"},
|
{conditions: {required: true, value: "2000-W99"}, expected: true, expectedImmutable: false, name: "[target] Invalid week string(2000-W99)"},
|
||||||
{conditions: {required: true, value: "2000-W00"}, expected: true, name: "[target] invalid week string(2000-W00)"},
|
{conditions: {required: true, value: "2000-W00"}, expected: true, expectedImmutable: false, name: "[target] invalid week string(2000-W00)"},
|
||||||
{conditions: {required: true, value: "2000-w01"}, expected: true, name: "[target] invalid week string(2000-w01)"},
|
{conditions: {required: true, value: "2000-w01"}, expected: true, expectedImmutable: false, name: "[target] invalid week string(2000-w01)"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -91,13 +91,13 @@
|
||||||
{conditions: {required: true, value: "12:00:00.001"}, expected: false, name: "[target] Valid time string(12:00:60.001)"},
|
{conditions: {required: true, value: "12:00:00.001"}, expected: false, name: "[target] Valid time string(12:00:60.001)"},
|
||||||
{conditions: {required: true, value: "12:00:00.01"}, expected: false, name: "[target] Valid time string(12:00:60.01)"},
|
{conditions: {required: true, value: "12:00:00.01"}, expected: false, name: "[target] Valid time string(12:00:60.01)"},
|
||||||
{conditions: {required: true, value: "12:00:00.1"}, expected: false, name: "[target] Valid time string(12:00:60.1)"},
|
{conditions: {required: true, value: "12:00:00.1"}, expected: false, name: "[target] Valid time string(12:00:60.1)"},
|
||||||
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
|
{conditions: {required: true, value: 1234567}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a number(1234567)"},
|
||||||
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a time object"},
|
{conditions: {required: true, value: new Date()}, expected: true, expectedImmutable: false, name: "[target] The value attribute is a time object"},
|
||||||
{conditions: {required: true, value: "25:00:00"}, expected: true, name: "[target] Invalid time string(25:00:00)"},
|
{conditions: {required: true, value: "25:00:00"}, expected: true, expectedImmutable: false, name: "[target] Invalid time string(25:00:00)"},
|
||||||
{conditions: {required: true, value: "12:60:00"}, expected: true, name: "[target] Invalid time string(12:60:00)"},
|
{conditions: {required: true, value: "12:60:00"}, expected: true, expectedImmutable: false, name: "[target] Invalid time string(12:60:00)"},
|
||||||
{conditions: {required: true, value: "12:00:60"}, expected: true, name: "[target] Invalid time string(12:00:60)"},
|
{conditions: {required: true, value: "12:00:60"}, expected: true, expectedImmutable: false, name: "[target] Invalid time string(12:00:60)"},
|
||||||
{conditions: {required: true, value: "12:00:00:001"}, expected: true, name: "[target] Invalid time string(12:00:00:001)"},
|
{conditions: {required: true, value: "12:00:00:001"}, expected: true, expectedImmutable: false, name: "[target] Invalid time string(12:00:00:001)"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -110,11 +110,11 @@
|
||||||
{conditions: {required: true, value: "123.01e-10"}, expected: false, name: "[target] Value is a number in scientific notation form(e is in lowercase)"},
|
{conditions: {required: true, value: "123.01e-10"}, expected: false, name: "[target] Value is a number in scientific notation form(e is in lowercase)"},
|
||||||
{conditions: {required: true, value: "123.01E+10"}, expected: false, name: "[target] Value is a number in scientific notation form(E is in uppercase)"},
|
{conditions: {required: true, value: "123.01E+10"}, expected: false, name: "[target] Value is a number in scientific notation form(E is in uppercase)"},
|
||||||
{conditions: {required: true, value: "-0"}, expected: false, name: "[target] Value is -0"},
|
{conditions: {required: true, value: "-0"}, expected: false, name: "[target] Value is -0"},
|
||||||
{conditions: {required: true, value: " 123 "}, expected: true, name: "[target] Value is a number with some white spaces"},
|
{conditions: {required: true, value: " 123 "}, expected: true, expectedImmutable: false, name: "[target] Value is a number with some white spaces"},
|
||||||
{conditions: {required: true, value: Math.pow(2, 1024)}, expected: true, name: "[target] Value is Math.pow(2, 1024)"},
|
{conditions: {required: true, value: Math.pow(2, 1024)}, expected: true, expectedImmutable: false, name: "[target] Value is Math.pow(2, 1024)"},
|
||||||
{conditions: {required: true, value: Math.pow(-2, 1024)}, expected: true, name: "[target] Value is Math.pow(-2, 1024)"},
|
{conditions: {required: true, value: Math.pow(-2, 1024)}, expected: true, expectedImmutable: false, name: "[target] Value is Math.pow(-2, 1024)"},
|
||||||
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] Value is a string that cannot be converted to a number"},
|
{conditions: {required: true, value: "abc"}, expected: true, expectedImmutable: false, name: "[target] Value is a string that cannot be converted to a number"},
|
||||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value attribute is empty string"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
testData: [
|
testData: [
|
||||||
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
|
||||||
{conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty"},
|
{conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty"},
|
||||||
{conditions: {required: true, value: ""}, expected: true , name: "[target] The value is empty"}
|
{conditions: {required: true, value: ""}, expected: true, expectedImmutable: false, name: "[target] The value is empty"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -5,8 +5,8 @@ var validator = {
|
||||||
test(function() {
|
test(function() {
|
||||||
self.pre_check(ctl, 'tooLong');
|
self.pre_check(ctl, 'tooLong');
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.tooLong,
|
ctl.validity.tooLong,
|
||||||
'The validity.tooLong should be true' + condStr);
|
'The validity.tooLong should be true' + condStr);
|
||||||
|
@ -23,8 +23,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "tooShort");
|
self.pre_check(ctl, "tooShort");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.tooShort,
|
ctl.validity.tooShort,
|
||||||
'The validity.tooShort should be true' + condStr);
|
'The validity.tooShort should be true' + condStr);
|
||||||
|
@ -41,8 +41,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "patternMismatch");
|
self.pre_check(ctl, "patternMismatch");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.patternMismatch,
|
ctl.validity.patternMismatch,
|
||||||
'The validity.patternMismatch should be true' + condStr);
|
'The validity.patternMismatch should be true' + condStr);
|
||||||
|
@ -59,8 +59,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "valueMissing");
|
self.pre_check(ctl, "valueMissing");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.valueMissing,
|
ctl.validity.valueMissing,
|
||||||
'The validity.valueMissing should be true' + condStr);
|
'The validity.valueMissing should be true' + condStr);
|
||||||
|
@ -77,8 +77,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "typeMismatch");
|
self.pre_check(ctl, "typeMismatch");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.typeMismatch,
|
ctl.validity.typeMismatch,
|
||||||
'The validity.typeMismatch should be true' + condStr);
|
'The validity.typeMismatch should be true' + condStr);
|
||||||
|
@ -95,8 +95,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "rangeOverflow");
|
self.pre_check(ctl, "rangeOverflow");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.rangeOverflow,
|
ctl.validity.rangeOverflow,
|
||||||
'The validity.rangeOverflow should be true' + condStr);
|
'The validity.rangeOverflow should be true' + condStr);
|
||||||
|
@ -113,8 +113,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "rangeUnderflow");
|
self.pre_check(ctl, "rangeUnderflow");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.rangeUnderflow,
|
ctl.validity.rangeUnderflow,
|
||||||
'The validity.rangeUnderflow should be true' + condStr);
|
'The validity.rangeUnderflow should be true' + condStr);
|
||||||
|
@ -131,8 +131,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "stepMismatch");
|
self.pre_check(ctl, "stepMismatch");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.stepMismatch,
|
ctl.validity.stepMismatch,
|
||||||
'The validity.stepMismatch should be true' + condStr);
|
'The validity.stepMismatch should be true' + condStr);
|
||||||
|
@ -149,8 +149,8 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "badInput");
|
self.pre_check(ctl, "badInput");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.badInput,
|
ctl.validity.badInput,
|
||||||
'The validity.badInput should be true' + condStr);
|
'The validity.badInput should be true' + condStr);
|
||||||
|
@ -167,14 +167,14 @@ var validator = {
|
||||||
test(function () {
|
test(function () {
|
||||||
self.pre_check(ctl, "customError");
|
self.pre_check(ctl, "customError");
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected) {
|
if (expected) {
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.customError,
|
ctl.validity.customError,
|
||||||
'The validity.customError attribute should be true' + condStr);
|
'The validity.customError attribute should be true' + condStr);
|
||||||
// validationMessage returns the empty string if ctl is barred from
|
// validationMessage returns the empty string if ctl is barred from
|
||||||
// constraint validation, which happens if ctl is disabled.
|
// constraint validation, which happens if ctl is disabled or readOnly.
|
||||||
if (ctl.disabled) {
|
if (ctl.disabled || ctl.readOnly) {
|
||||||
assert_equals(
|
assert_equals(
|
||||||
ctl.validationMessage, '',
|
ctl.validationMessage, '',
|
||||||
'The validationMessage attribute must be empty' + condStr);
|
'The validationMessage attribute must be empty' + condStr);
|
||||||
|
@ -200,8 +200,8 @@ var validator = {
|
||||||
var self = this;
|
var self = this;
|
||||||
test(function () {
|
test(function () {
|
||||||
self.iterate_over(ctl, data).forEach(function(val) {
|
self.iterate_over(ctl, data).forEach(function(val) {
|
||||||
const {ctl, data, condStr} = val;
|
const {ctl, expected, condStr} = val;
|
||||||
if (data.expected)
|
if (expected)
|
||||||
assert_true(
|
assert_true(
|
||||||
ctl.validity.valid,
|
ctl.validity.valid,
|
||||||
'The validity.valid should be true' + condStr);
|
'The validity.valid should be true' + condStr);
|
||||||
|
@ -389,39 +389,54 @@ var validator = {
|
||||||
},
|
},
|
||||||
|
|
||||||
iterate_over: function(ctl, data) {
|
iterate_over: function(ctl, data) {
|
||||||
// Iterate over normal, disabled, readonly, and both.
|
// Iterate over normal, disabled, readonly, and both (if applicable).
|
||||||
|
var ctlNormal = ctl.cloneNode(true);
|
||||||
|
this.set_conditions(ctlNormal, data.conditions);
|
||||||
|
if (data.dirty)
|
||||||
|
this.set_dirty(ctlNormal);
|
||||||
|
|
||||||
var ctlDisabled = ctl.cloneNode(true);
|
var ctlDisabled = ctl.cloneNode(true);
|
||||||
this.set_conditions(ctlDisabled, data.conditions);
|
this.set_conditions(ctlDisabled, data.conditions);
|
||||||
if (data.dirty)
|
if (data.dirty)
|
||||||
this.set_dirty(ctlDisabled);
|
this.set_dirty(ctlDisabled);
|
||||||
ctlDisabled.disabled = true;
|
ctlDisabled.disabled = true;
|
||||||
|
|
||||||
var ctlReadonly = ctl.cloneNode(true);
|
var expectedImmutable =
|
||||||
this.set_conditions(ctlReadonly, data.conditions);
|
data.expectedImmutable !== undefined ? data.expectedImmutable : data.expected;
|
||||||
if (data.dirty)
|
|
||||||
this.set_dirty(ctlReadonly);
|
|
||||||
ctlReadonly.readonly = true;
|
|
||||||
|
|
||||||
var ctlBoth = ctl.cloneNode(true);
|
var variants = [
|
||||||
this.set_conditions(ctlBoth, data.conditions);
|
{ctl: ctlNormal, expected: data.expected, condStr: '.'},
|
||||||
if (data.dirty)
|
{ctl: ctlDisabled, expected: expectedImmutable, condStr: ', when control is disabled.'},
|
||||||
this.set_dirty(ctlBoth);
|
];
|
||||||
ctlBoth.disabled = true;
|
|
||||||
ctlBoth.readonly = true;
|
|
||||||
|
|
||||||
ctl = ctl.cloneNode(true);
|
if ('readOnly' in ctl) {
|
||||||
this.set_conditions(ctl, data.conditions);
|
var ctlReadonly = ctl.cloneNode(true);
|
||||||
|
this.set_conditions(ctlReadonly, data.conditions);
|
||||||
|
if (data.dirty)
|
||||||
|
this.set_dirty(ctlReadonly);
|
||||||
|
ctlReadonly.readOnly = true;
|
||||||
|
|
||||||
return [
|
var ctlBoth = ctl.cloneNode(true);
|
||||||
{ctl: ctl, data: data, condStr: '.'},
|
this.set_conditions(ctlBoth, data.conditions);
|
||||||
{ctl: ctlDisabled, data: data, condStr: ', when control is disabled.'},
|
if (data.dirty)
|
||||||
{ctl: ctlReadonly, data: data, condStr: ', when control is readonly.'},
|
this.set_dirty(ctlBoth);
|
||||||
{
|
ctlBoth.disabled = true;
|
||||||
|
ctlBoth.readOnly = true;
|
||||||
|
|
||||||
|
variants.push({
|
||||||
|
ctl: ctlReadonly,
|
||||||
|
expected: expectedImmutable,
|
||||||
|
condStr: ', when control is readonly.'
|
||||||
|
});
|
||||||
|
|
||||||
|
variants.push({
|
||||||
ctl: ctlBoth,
|
ctl: ctlBoth,
|
||||||
data: data,
|
expected: expectedImmutable,
|
||||||
condStr: ', when control is disabled & readonly.'
|
condStr: ', when control is disabled & readonly.'
|
||||||
},
|
});
|
||||||
]
|
}
|
||||||
|
|
||||||
|
return variants;
|
||||||
},
|
},
|
||||||
|
|
||||||
run_test: function(testee, method) {
|
run_test: function(testee, method) {
|
||||||
|
|
|
@ -170,6 +170,7 @@ var WebNFCTest = (() => {
|
||||||
this.reading_messages_ = [];
|
this.reading_messages_ = [];
|
||||||
this.operations_suspended_ = false;
|
this.operations_suspended_ = false;
|
||||||
this.is_formatted_tag_ = false;
|
this.is_formatted_tag_ = false;
|
||||||
|
this.data_transfer_failed_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NFC delegate functions.
|
// NFC delegate functions.
|
||||||
|
@ -192,6 +193,9 @@ var WebNFCTest = (() => {
|
||||||
// Resolves with NotAllowedError if there are NDEF records on the device
|
// Resolves with NotAllowedError if there are NDEF records on the device
|
||||||
// and overwrite is false.
|
// and overwrite is false.
|
||||||
resolve(createNDEFError(device.mojom.NDEFErrorType.NOT_ALLOWED));
|
resolve(createNDEFError(device.mojom.NDEFErrorType.NOT_ALLOWED));
|
||||||
|
} else if (this.data_transfer_failed_) {
|
||||||
|
// Resolves with NetworkError if data transfer fails.
|
||||||
|
resolve(createNDEFError(device.mojom.NDEFErrorType.IO_ERROR));
|
||||||
} else {
|
} else {
|
||||||
resolve(createNDEFError(null));
|
resolve(createNDEFError(null));
|
||||||
}
|
}
|
||||||
|
@ -290,6 +294,7 @@ var WebNFCTest = (() => {
|
||||||
this.operations_suspended_ = false;
|
this.operations_suspended_ = false;
|
||||||
this.cancelPendingPushOperation();
|
this.cancelPendingPushOperation();
|
||||||
this.is_formatted_tag_ = false;
|
this.is_formatted_tag_ = false;
|
||||||
|
this.data_transfer_failed_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelPendingPushOperation() {
|
cancelPendingPushOperation() {
|
||||||
|
@ -365,6 +370,10 @@ var WebNFCTest = (() => {
|
||||||
setIsFormattedTag(isFormatted) {
|
setIsFormattedTag(isFormatted) {
|
||||||
this.is_formatted_tag_ = isFormatted;
|
this.is_formatted_tag_ = isFormatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
simulateDataTransferFails() {
|
||||||
|
this.data_transfer_failed_ = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let testInternal = {
|
let testInternal = {
|
||||||
|
|
|
@ -8,7 +8,8 @@ from .base import (get_free_port,
|
||||||
cmd_arg,
|
cmd_arg,
|
||||||
browser_command)
|
browser_command)
|
||||||
from ..executors.executormarionette import (MarionetteTestharnessExecutor, # noqa: F401
|
from ..executors.executormarionette import (MarionetteTestharnessExecutor, # noqa: F401
|
||||||
MarionetteRefTestExecutor) # noqa: F401
|
MarionetteRefTestExecutor, # noqa: F401
|
||||||
|
MarionetteCrashtestExecutor) # noqa: F401
|
||||||
from .firefox import (get_timeout_multiplier, # noqa: F401
|
from .firefox import (get_timeout_multiplier, # noqa: F401
|
||||||
run_info_extras as fx_run_info_extras,
|
run_info_extras as fx_run_info_extras,
|
||||||
update_properties, # noqa: F401
|
update_properties, # noqa: F401
|
||||||
|
@ -20,7 +21,8 @@ __wptrunner__ = {"product": "firefox_android",
|
||||||
"check_args": "check_args",
|
"check_args": "check_args",
|
||||||
"browser": "FirefoxAndroidBrowser",
|
"browser": "FirefoxAndroidBrowser",
|
||||||
"executor": {"testharness": "MarionetteTestharnessExecutor",
|
"executor": {"testharness": "MarionetteTestharnessExecutor",
|
||||||
"reftest": "MarionetteRefTestExecutor"},
|
"reftest": "MarionetteRefTestExecutor",
|
||||||
|
"crashtest": "MarionetteCrashtestExecutor"},
|
||||||
"browser_kwargs": "browser_kwargs",
|
"browser_kwargs": "browser_kwargs",
|
||||||
"executor_kwargs": "executor_kwargs",
|
"executor_kwargs": "executor_kwargs",
|
||||||
"env_extras": "env_extras",
|
"env_extras": "env_extras",
|
||||||
|
|
|
@ -991,15 +991,16 @@ class MarionetteCrashtestExecutor(CrashtestExecutor):
|
||||||
if not success:
|
if not success:
|
||||||
status = data[0]
|
status = data[0]
|
||||||
|
|
||||||
|
extra = None
|
||||||
if self.debug and (success or status not in ("CRASH", "INTERNAL-ERROR")):
|
if self.debug and (success or status not in ("CRASH", "INTERNAL-ERROR")):
|
||||||
assertion_count = self.protocol.asserts.get()
|
assertion_count = self.protocol.asserts.get()
|
||||||
if assertion_count is not None:
|
if assertion_count is not None:
|
||||||
data["extra"] = {"assertion_count": assertion_count}
|
extra = {"assertion_count": assertion_count}
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
return self.convert_result(test, data)
|
return self.convert_result(test, data)
|
||||||
|
|
||||||
return (test.result_cls(**data), [])
|
return (test.result_cls(extra=extra, *data), [])
|
||||||
|
|
||||||
def do_crashtest(self, protocol, url, timeout):
|
def do_crashtest(self, protocol, url, timeout):
|
||||||
if self.protocol.coverage.is_enabled:
|
if self.protocol.coverage.is_enabled:
|
||||||
|
|
|
@ -32,7 +32,8 @@ function wait_paints() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function screenshot_if_ready() {
|
function screenshot_if_ready() {
|
||||||
if (root.classList.contains("%(classname)s") &&
|
if (root &&
|
||||||
|
root.classList.contains("%(classname)s") &&
|
||||||
observer === null) {
|
observer === null) {
|
||||||
observer = new MutationObserver(wait_paints);
|
observer = new MutationObserver(wait_paints);
|
||||||
observer.observe(root, {attributes: true});
|
observer.observe(root, {attributes: true});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import ctypes
|
import ctypes
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import plistlib
|
import plistlib
|
||||||
|
@ -12,7 +11,8 @@ SYSTEM = platform.system().lower()
|
||||||
|
|
||||||
|
|
||||||
class FontInstaller(object):
|
class FontInstaller(object):
|
||||||
def __init__(self, font_dir=None, **fonts):
|
def __init__(self, logger, font_dir=None, **fonts):
|
||||||
|
self.logger = logger
|
||||||
self.font_dir = font_dir
|
self.font_dir = font_dir
|
||||||
self.installed_fonts = False
|
self.installed_fonts = False
|
||||||
self.created_dir = False
|
self.created_dir = False
|
||||||
|
@ -26,14 +26,13 @@ class FontInstaller(object):
|
||||||
font_name = font_path.split('/')[-1]
|
font_name = font_path.split('/')[-1]
|
||||||
install = getattr(self, 'install_%s_font' % SYSTEM, None)
|
install = getattr(self, 'install_%s_font' % SYSTEM, None)
|
||||||
if not install:
|
if not install:
|
||||||
logging.warning('Font installation not supported on %s',
|
self.logger.warning('Font installation not supported on %s' % SYSTEM)
|
||||||
SYSTEM)
|
|
||||||
return False
|
return False
|
||||||
if install(font_name, font_path):
|
if install(font_name, font_path):
|
||||||
self.installed_fonts = True
|
self.installed_fonts = True
|
||||||
logging.info('Installed font: %s', font_name)
|
self.logger.info('Installed font: %s' % font_name)
|
||||||
else:
|
else:
|
||||||
logging.warning('Unable to install font: %s', font_name)
|
self.logger.warning('Unable to install font: %s' % font_name)
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
if not self.installed_fonts:
|
if not self.installed_fonts:
|
||||||
|
@ -43,12 +42,12 @@ class FontInstaller(object):
|
||||||
font_name = font_path.split('/')[-1]
|
font_name = font_path.split('/')[-1]
|
||||||
remove = getattr(self, 'remove_%s_font' % SYSTEM, None)
|
remove = getattr(self, 'remove_%s_font' % SYSTEM, None)
|
||||||
if not remove:
|
if not remove:
|
||||||
logging.warning('Font removal not supported on %s', SYSTEM)
|
self.logger.warning('Font removal not supported on %s' % SYSTEM)
|
||||||
return False
|
return False
|
||||||
if remove(font_name, font_path):
|
if remove(font_name, font_path):
|
||||||
logging.info('Removed font: %s', font_name)
|
self.logger.info('Removed font: %s' % font_name)
|
||||||
else:
|
else:
|
||||||
logging.warning('Unable to remove font: %s', font_name)
|
self.logger.warning('Unable to remove font: %s' % font_name)
|
||||||
|
|
||||||
def install_linux_font(self, font_name, font_path):
|
def install_linux_font(self, font_name, font_path):
|
||||||
if not self.font_dir:
|
if not self.font_dir:
|
||||||
|
@ -62,7 +61,7 @@ class FontInstaller(object):
|
||||||
fc_cache_returncode = call('fc-cache')
|
fc_cache_returncode = call('fc-cache')
|
||||||
return not fc_cache_returncode
|
return not fc_cache_returncode
|
||||||
except OSError: # If fontconfig doesn't exist, return False
|
except OSError: # If fontconfig doesn't exist, return False
|
||||||
logging.error('fontconfig not available on this Linux system.')
|
self.logger.error('fontconfig not available on this Linux system.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def install_darwin_font(self, font_name, font_path):
|
def install_darwin_font(self, font_name, font_path):
|
||||||
|
@ -110,7 +109,7 @@ class FontInstaller(object):
|
||||||
fc_cache_returncode = call('fc-cache')
|
fc_cache_returncode = call('fc-cache')
|
||||||
return not fc_cache_returncode
|
return not fc_cache_returncode
|
||||||
except OSError: # If fontconfig doesn't exist, return False
|
except OSError: # If fontconfig doesn't exist, return False
|
||||||
logging.error('fontconfig not available on this Linux system.')
|
self.logger.error('fontconfig not available on this Linux system.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def remove_darwin_font(self, font_name, _):
|
def remove_darwin_font(self, font_name, _):
|
||||||
|
|
|
@ -150,6 +150,7 @@ def run_tests(config, test_paths, product, **kwargs):
|
||||||
|
|
||||||
if kwargs["install_fonts"]:
|
if kwargs["install_fonts"]:
|
||||||
env_extras.append(FontInstaller(
|
env_extras.append(FontInstaller(
|
||||||
|
logger,
|
||||||
font_dir=kwargs["font_dir"],
|
font_dir=kwargs["font_dir"],
|
||||||
ahem=os.path.join(test_paths["/"]["tests_path"], "fonts/Ahem.ttf")
|
ahem=os.path.join(test_paths["/"]["tests_path"], "fonts/Ahem.ttf")
|
||||||
))
|
))
|
||||||
|
|
|
@ -207,4 +207,27 @@ nfc_test(async (t, mockNFC) => {
|
||||||
}, "Test that NDEFReader.onreading should be fired on an unformatted NFC tag \
|
}, "Test that NDEFReader.onreading should be fired on an unformatted NFC tag \
|
||||||
with empty records array for NDEFMessage.");
|
with empty records array for NDEFMessage.");
|
||||||
|
|
||||||
|
nfc_test(async (t, mockNFC) => {
|
||||||
|
const reader = new NDEFReader();
|
||||||
|
const controller = new AbortController();
|
||||||
|
const message = createMessage([createTextRecord(test_text_data),
|
||||||
|
createMimeRecordFromJson(test_json_data),
|
||||||
|
createMimeRecord(test_buffer_data),
|
||||||
|
createUnknownRecord(test_buffer_data),
|
||||||
|
createUrlRecord(test_url_data),
|
||||||
|
createUrlRecord(test_url_data, true),
|
||||||
|
createRecord('w3.org:xyz', test_buffer_data)],
|
||||||
|
test_message_origin);
|
||||||
|
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
|
||||||
|
const promise = readerWatcher.wait_for("reading").then(event => {
|
||||||
|
assert_equals(event.serialNumber, fake_tag_serial_number);
|
||||||
|
assertWebNDEFMessagesEqual(event.message, new NDEFMessage(message));
|
||||||
|
controller.abort();
|
||||||
|
});
|
||||||
|
await reader.scan({signal : controller.signal});
|
||||||
|
|
||||||
|
mockNFC.setReadingMessage(message);
|
||||||
|
await promise;
|
||||||
|
}, "Test that reading message with multiple records should succeed.");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -276,7 +276,7 @@ nfc_test(async () => {
|
||||||
|
|
||||||
nfc_test(async (t, mockNFC) => {
|
nfc_test(async (t, mockNFC) => {
|
||||||
const writer = new NDEFWriter();
|
const writer = new NDEFWriter();
|
||||||
let message = createMessage([createTextRecord(test_text_data),
|
const message = createMessage([createTextRecord(test_text_data),
|
||||||
createMimeRecordFromJson(test_json_data),
|
createMimeRecordFromJson(test_json_data),
|
||||||
createMimeRecord(test_buffer_data),
|
createMimeRecord(test_buffer_data),
|
||||||
createUnknownRecord(test_buffer_data),
|
createUnknownRecord(test_buffer_data),
|
||||||
|
@ -308,9 +308,12 @@ nfc_test(async (t, mockNFC) => {
|
||||||
assertNDEFMessagesEqual(buffer_view, mockNFC.pushedMessage());
|
assertNDEFMessagesEqual(buffer_view, mockNFC.pushedMessage());
|
||||||
}, "Test that NDEFWriter.push succeeds when message is ArrayBufferView.");
|
}, "Test that NDEFWriter.push succeeds when message is ArrayBufferView.");
|
||||||
|
|
||||||
nfc_test(async () => {
|
nfc_test(async (t, mockNFC) => {
|
||||||
const writer = new NDEFWriter();
|
const writer = new NDEFWriter();
|
||||||
await writer.push(createMessage([createRecord('empty')]));
|
await writer.push(createMessage([createRecord('empty')]));
|
||||||
|
const receivedMessage = mockNFC.pushedMessage();
|
||||||
|
assert_equals(receivedMessage.data.length, 1);
|
||||||
|
assert_equals(receivedMessage.data[0].recordType, 'empty', 'recordType');
|
||||||
}, "NDEFWriter.push with 'empty' record should succeed.");
|
}, "NDEFWriter.push with 'empty' record should succeed.");
|
||||||
|
|
||||||
nfc_test(async (t, mockNFC) => {
|
nfc_test(async (t, mockNFC) => {
|
||||||
|
@ -433,4 +436,11 @@ nfc_test(async (t, mockNFC) => {
|
||||||
await promise_rejects(t, 'NotAllowedError', p);
|
await promise_rejects(t, 'NotAllowedError', p);
|
||||||
}, "NDEFWriter.push should fail when there are NDEF records on the NFC device \
|
}, "NDEFWriter.push should fail when there are NDEF records on the NFC device \
|
||||||
and NDEFPushOptions.overwrite is false.");
|
and NDEFPushOptions.overwrite is false.");
|
||||||
|
|
||||||
|
nfc_test(async (t, mockNFC) => {
|
||||||
|
const writer = new NDEFWriter();
|
||||||
|
mockNFC.simulateDataTransferFails();
|
||||||
|
await promise_rejects(t, 'NetworkError', writer.push(test_text_data));
|
||||||
|
}, "NDEFWriter.push should fail with NetworkError when NFC data transfer fails.");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue