Commit 5dcf57f5 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@d67fec6063da225ec5da00db820a401783922264

Using wpt-import in Chromium 53095cfc.

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
yhirano@chromium.org, mkwst@chromium.org, japhet@chromium.org:
  external/wpt/fetch

NOAUTOREVERT=true
TBR=kyleju

No-Export: true
Change-Id: I718561339218d07e74a35786d6d891194ccf654f
Reviewed-on: https://chromium-review.googlesource.com/c/1356017
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#612520}
parent 3e42c3e7
......@@ -75,8 +75,6 @@
testsPerSlice: 1,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -76,8 +76,6 @@
testsPerSlice: 1,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -86,8 +86,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -69,8 +69,6 @@
testsPerSlice: 1,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -65,8 +65,6 @@
testsPerSlice: 1,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -67,8 +67,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -70,8 +70,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -71,8 +71,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -70,8 +70,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
var styles = {
......
......@@ -70,8 +70,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
// as we're dealing with em-based lengths, we need to define a font-size
......
......@@ -70,8 +70,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
// clone and overwrite initial styles to be
......
......@@ -71,8 +71,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
// clone and overwrite initial styles to be
......
......@@ -71,8 +71,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
// have parent transition the font-size only
......
......@@ -93,8 +93,6 @@
testsPerSlice: 50,
// milliseconds to wait before calling teardown and ending test
duration: parseFloat(duration) * 1000,
// the global suite timeout
timeout: timeout,
// prepare individual test
setup: function(data, options) {
generalParallelTest.setup(data, options);
......
......@@ -81,7 +81,7 @@ root.runParallelAsyncHarness = function(options) {
options.tests.forEach(function(data, index) {
data.cases = {};
cases.forEach(function(name) {
data.cases[name] = async_test(data.name + " / " + name, {timeout: options.timeout || 60000});
data.cases[name] = async_test(data.name + " / " + name);
});
});
......
<!DOCTYPE html>
<title>Fetch destination test for prefetching</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/common/media.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
let frame;
// Set up the service worker and the frame.
promise_test(t => {
const kScope = 'resources/empty.https.html';
const kScript = 'resources/fetch-destination-worker.js';
return service_worker_unregister_and_register(t, kScript, kScope)
.then(registration => {
add_completion_callback(() => {
registration.unregister();
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(() => {
return with_iframe(kScope);
})
.then(f => {
frame = f;
add_completion_callback(() => { f.remove(); });
});
}, 'Initialize global state');
// HTMLLinkElement with rel=prefetch - empty string destination
promise_test(async t => {
await new Promise((resolve, reject) => {
let node = frame.contentWindow.document.createElement("link");
node.rel = "prefetch";
node.onload = resolve;
node.onerror = reject;
node.href = "dummy?dest=";
frame.contentWindow.document.body.appendChild(node);
}).catch(() => {
assert_unreached("Fetch errored.");
});
}, 'HTMLLinkElement with rel=prefetch fetches with an empty string Request.destination');
</script>
......@@ -425,18 +425,4 @@ promise_test(async t => {
});
}, 'HTMLLinkElement with rel=preload and as=manifest fetches with a "manifest" Request.destination');
// HTMLLinkElement with rel=prefetch - empty string destination
promise_test(async t => {
await new Promise((resolve, reject) => {
let node = frame.contentWindow.document.createElement("link");
node.rel = "prefetch";
node.onload = resolve;
node.onerror = reject;
node.href = "dummy?dest=";
frame.contentWindow.document.body.appendChild(node);
}).catch(() => {
assert_unreached("Fetch errored.");
});
}, 'HTMLLinkElement with rel=prefetch fetches with an empty string Request.destination');
</script>
import time
def main(request, response):
delay = float(request.GET.first("ms", 500)) / 1E3
count = int(request.GET.first("count", 50))
# Read request body
request.body
time.sleep(delay)
response.headers.set("Content-type", "text/plain")
response.write_status_headers()
time.sleep(delay);
for i in xrange(count):
response.writer.write_content("TEST_TRICKLE\n")
time.sleep(delay)
import time
def main(request, response):
# no-cache itself to ensure the user agent finds a new version for each update.
headers = [('Cache-Control', 'no-cache, must-revalidate'),
('Pragma', 'no-cache')]
content_type = ''
extra_body = ''
content_type = 'application/javascript'
headers.append(('Content-Type', content_type))
extra_body = "self.onfetch = (event) => { event.respondWith(fetch(event.request)); };"
# Return a different script for each access. Use .time() and .clock() for
# best time resolution across different platforms.
return headers, '/* %s %s */ %s' % (time.time(), time.clock(), extra_body)
<!DOCTYPE html>
<title>Update on navigation</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script src='resources/test-helpers.sub.js'></script>
<script>
promise_test(async (t) => {
var script = 'resources/update-fetch-worker.py';
var scope = 'resources/trickle.py?ms=1000&count=1';
const registration = await service_worker_unregister_and_register(t, script, scope);
t.add_cleanup(() => registration.unregister());
if (registration.installing)
await wait_for_state(t, registration.installing, 'activated');
const frame = await with_iframe(scope);
t.add_cleanup(() => frame.remove());
}, 'The active service worker in charge of a navigation load should not be terminated as part of updating the registration');
</script>
......@@ -6,9 +6,8 @@ if (typeof(TIMEOUT_OVERRIDE) != 'undefined') {
GLOBAL_TIMEOUT = TIMEOUT + 2000; // In milliseconds.
setup({timeout: GLOBAL_TIMEOUT});
var onstarted = false;
var neverFireTest = async_test('Events that should not fire',
{timeout: TIMEOUT});
var onstartTest = async_test('onstart', {timeout: TIMEOUT});
var neverFireTest = async_test('Events that should not fire');
var onstartTest = async_test('onstart');
var reco = new SpeechRecognition();
reco.onstart = onstartTest.step_func(function(event) {
......@@ -41,7 +40,7 @@ function CountTest(name, min, max) {
this.min = min;
this.max = max;
this.sum = 0;
this.asyncTest = async_test(name, {timeout: TIMEOUT});
this.asyncTest = async_test(name);
this.count = function(increment) { this.sum += increment; };
......@@ -77,7 +76,7 @@ function CycleTest(name) {
this.name = name;
this.count = 0; // Counts number of start / end cycles.
this.started = false; // Tracks whether last event was a start or end event.
this.test = async_test(name + ' start/stop', {timeout: TIMEOUT});
this.test = async_test(name + ' start/stop');
this.startEvent = function() {
var cycle = this;
......
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing inline-size with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#InlineSizeProperty"/>
<h:link rel="help" href="https://drafts.csswg.org/css-logical/#dimension-properties"/>
<h:meta name="assert" content="inline-size supports only the grammar 'auto | length-percentage'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("inline-size", "none");
test_invalid_value("inline-size", "-10px");
test_invalid_value("inline-size", "20");
test_invalid_value("inline-size", "30deg");
test_invalid_value("inline-size", "40px 50%");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing inline-size with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#InlineSizeProperty"/>
<h:link rel="help" href="https://drafts.csswg.org/css-logical/#dimension-properties"/>
<h:meta name="assert" content="inline-size supports the full grammar 'auto | length-percentage'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("inline-size", "auto");
test_valid_value("inline-size", "0", "0px");
test_valid_value("inline-size", "10px");
test_valid_value("inline-size", "20%");
test_valid_value("inline-size", "calc(2em + 3ex)");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-inside with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#ShapeInsideProperty"/>
<h:meta name="assert" content="shape-inside supports only the grammar 'auto | [ basic-shape | uri ]+'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("shape-inside", "none");
test_invalid_value("shape-inside", "auto circle(10px at 20px -30px)");
test_invalid_value("shape-inside", 'url("https://example.com/") auto');
test_invalid_value("shape-inside", "inset(25%)");
]]></script>
</svg>
This is a testharness.js-based test.
FAIL e.style['shape-inside'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-inside'] = "circle(10px at 20px -30px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-inside'] = "ellipse(10px 20px at -30px 40px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-inside'] = "polygon(10px 20px, -30px 40px, 50px 60px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-inside'] = "url(\"https://example.com/\")" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-inside'] = "circle(10px at 20px -30px) url(\"https://example.com/\") ellipse(10px 20px at -30px 40px)" should set the property value assert_not_equals: property should be set got disallowed value ""
Harness: the test ran to completion.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-inside with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#ShapeInsideProperty"/>
<h:meta name="assert" content="shape-inside supports the full grammar 'auto | [ basic-shape | uri ]+'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("shape-inside", "auto");
test_valid_value("shape-inside", "circle(10px at 20px -30px)");
test_valid_value("shape-inside", "ellipse(10px 20px at -30px 40px)");
test_valid_value("shape-inside", "polygon(10px 20px, -30px 40px, 50px 60px)");
test_valid_value("shape-inside", 'url("https://example.com/")');
test_valid_value("shape-inside", 'circle(10px at 20px -30px) url("https://example.com/") ellipse(10px 20px at -30px 40px)');
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-margin with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#ShapeMarginProperty"/>
<h:meta name="assert" content="shape-margin supports only the grammar 'length-percentage'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("shape-margin", "auto");
test_invalid_value("shape-margin", "-10px");
test_invalid_value("shape-margin", "20");
test_invalid_value("shape-margin", "30deg");
test_invalid_value("shape-margin", "40px 50%");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-margin with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#ShapeMarginProperty"/>
<h:meta name="assert" content="shape-margin supports the full grammar 'length-percentage'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("shape-margin", "0", "0px");
test_valid_value("shape-margin", "10px");
test_valid_value("shape-margin", "20%");
test_valid_value("shape-margin", "calc(2em + 3ex)");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-subtract with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextShapeSubtract"/>
<h:meta name="assert" content="shape-subtract supports only the grammar 'auto | [ basic-shape | uri ]+'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("shape-subtract", "none");
test_invalid_value("shape-subtract", "auto circle(10px at 20px -30px)");
test_invalid_value("shape-subtract", 'url("https://example.com/") auto');
test_invalid_value("shape-subtract", "inset(25%)");
]]></script>
</svg>
This is a testharness.js-based test.
FAIL e.style['shape-subtract'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-subtract'] = "circle(10px at 20px -30px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-subtract'] = "ellipse(10px 20px at -30px 40px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-subtract'] = "polygon(10px 20px, -30px 40px, 50px 60px)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-subtract'] = "url(\"https://example.com/\")" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['shape-subtract'] = "circle(10px at 20px -30px) url(\"https://example.com/\") ellipse(10px 20px at -30px 40px)" should set the property value assert_not_equals: property should be set got disallowed value ""
Harness: the test ran to completion.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing shape-subtract with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextShapeSubtract"/>
<h:meta name="assert" content="shape-subtract supports the full grammar 'auto | [ basic-shape | uri ]+'"/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("shape-subtract", "auto");
test_valid_value("shape-subtract", "circle(10px at 20px -30px)");
test_valid_value("shape-subtract", "ellipse(10px 20px at -30px 40px)");
test_valid_value("shape-subtract", "polygon(10px 20px, -30px 40px, 50px 60px)");
test_valid_value("shape-subtract", 'url("https://example.com/")');
test_valid_value("shape-subtract", 'circle(10px at 20px -30px) url("https://example.com/") ellipse(10px 20px at -30px 40px)');
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-anchor with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextAnchorProperty"/>
<h:meta name="assert" content="text-anchor supports only the grammar 'start | middle | end'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("text-anchor", "auto");
test_invalid_value("text-anchor", "start middle");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-anchor with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextAnchorProperty"/>
<h:meta name="assert" content="text-anchor supports the full grammar 'start | middle | end'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("text-anchor", "start");
test_valid_value("text-anchor", "middle");
test_valid_value("text-anchor", "end");
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-decoration-fill with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextDecorationFillProperty"/>
<h:meta name="assert" content="text-decoration-fill supports only the paint grammar 'none | color | url [none | color]? | context-fill | context-stroke'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("text-decoration-fill", "auto");
test_invalid_value("text-decoration-fill", "none red");
test_invalid_value("text-decoration-fill", 'none url("https://example.com/")');
test_invalid_value("text-decoration-fill", 'red url("https://example.com/")');
test_invalid_value("text-decoration-fill", 'url("https://example.com/") none red');
]]></script>
</svg>
This is a testharness.js-based test.
FAIL e.style['text-decoration-fill'] = "none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "context-fill" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "context-stroke" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "rgb(12, 34, 56)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "url(\"https://example.com/\")" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "url(\"https://example.com/\") none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-fill'] = "url(\"https://example.com/\") rgb(12, 34, 56)" should set the property value assert_not_equals: property should be set got disallowed value ""
Harness: the test ran to completion.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-decoration-fill with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextDecorationFillProperty"/>
<h:meta name="assert" content="text-decoration-fill supports the full paint grammar 'none | color | url [none | color]? | context-fill | context-stroke'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("text-decoration-fill", "none");
test_valid_value("text-decoration-fill", "context-fill");
test_valid_value("text-decoration-fill", "context-stroke");
test_valid_value("text-decoration-fill", "rgb(12, 34, 56)");
test_valid_value("text-decoration-fill", 'url("https://example.com/")');
test_valid_value("text-decoration-fill", 'url("https://example.com/") none');
test_valid_value("text-decoration-fill", 'url("https://example.com/") rgb(12, 34, 56)');
]]></script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-decoration-stroke with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextDecorationStrokeProperty"/>
<h:meta name="assert" content="text-decoration-stroke supports only the paint grammar 'none | color | url [none | color]? | context-fill | context-stroke'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("text-decoration-stroke", "auto");
test_invalid_value("text-decoration-stroke", "none red");
test_invalid_value("text-decoration-stroke", 'none url("https://example.com/")');
test_invalid_value("text-decoration-stroke", 'red url("https://example.com/")');
test_invalid_value("text-decoration-stroke", 'url("https://example.com/") none red');
]]></script>
</svg>
This is a testharness.js-based test.
FAIL e.style['text-decoration-stroke'] = "none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "context-fill" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "context-stroke" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "rgb(12, 34, 56)" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "url(\"https://example.com/\")" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "url(\"https://example.com/\") none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['text-decoration-stroke'] = "url(\"https://example.com/\") rgb(12, 34, 56)" should set the property value assert_not_equals: property should be set got disallowed value ""
Harness: the test ran to completion.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="800px">
<title>SVG Text: parsing text-decoration-stroke with valid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/text.html#TextDecorationStrokeProperty"/>
<h:meta name="assert" content="text-decoration-stroke supports the full paint grammar 'none | color | url [none | color]? | context-fill | context-stroke'."/>
</metadata>
<g id="target"></g>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<h:script src="/css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_valid_value("text-decoration-stroke", "none");
test_valid_value("text-decoration-stroke", "context-fill");
test_valid_value("text-decoration-stroke", "context-stroke");
test_valid_value("text-decoration-stroke", "rgb(12, 34, 56)");
test_valid_value("text-decoration-stroke", 'url("https://example.com/")');
test_valid_value("text-decoration-stroke", 'url("https://example.com/") none');
test_valid_value("text-decoration-stroke", 'url("https://example.com/") rgb(12, 34, 56)');
]]></script>
</svg>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment