mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee
This commit is contained in:
parent
fe1a057bd1
commit
24183668c4
1960 changed files with 29853 additions and 10555 deletions
|
@ -0,0 +1,44 @@
|
|||
<!doctype html>
|
||||
<meta charset={{GET[encoding]}}> <!-- ends up as <meta charset> by default which is windows-1252 -->
|
||||
<meta name=variant content="?encoding=x-cp1251">
|
||||
<meta name=variant content="?encoding=utf8">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
function expected(encoding) {
|
||||
return "?" + {
|
||||
"UTF-8": "%C3%BF",
|
||||
"windows-1251": "&%23255;",
|
||||
"windows-1252": "%FF"
|
||||
}[encoding];
|
||||
}
|
||||
|
||||
[
|
||||
[(win, input) => { win.location = input; }, "location [PutForwards]"],
|
||||
[(win, input) => { win.location.assign(input); }, "location.assign()"],
|
||||
[(win, input) => { win.location.replace(input); }, "location.replace()"],
|
||||
[(win, input) => { win.location.href = input; }, "location.href"]
|
||||
].forEach(([callback, desc]) => {
|
||||
async_test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe")),
|
||||
actualEncoding = document.characterSet
|
||||
callback(frame.contentWindow, "/common/blank.html?\u00FF");
|
||||
frame.onload = t.step_func_done(() => {
|
||||
assert_equals(frame.contentWindow.location.search, expected(actualEncoding));
|
||||
});
|
||||
}, desc);
|
||||
});
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe")),
|
||||
actualEncoding = document.characterSet;
|
||||
frame.src = "/common/blank.html";
|
||||
frame.onload = t.step_func(() => {
|
||||
frame.contentWindow.location.search = "\u00FF";
|
||||
frame.onload = t.step_func_done(() => {
|
||||
assert_equals(frame.contentWindow.location.search, expected(actualEncoding));
|
||||
});
|
||||
});
|
||||
}, "location.search");
|
||||
</script>
|
|
@ -1,3 +1,6 @@
|
|||
// NOTE: this file needs to be split up rather than expanded. See ../location.sub.html for some
|
||||
// extracted tests. Tracked by https://github.com/w3c/web-platform-tests/issues/4934.
|
||||
|
||||
setup({explicit_done:true});
|
||||
onload = function() {
|
||||
var encoding = '{{GET[encoding]}}';
|
||||
|
@ -35,7 +38,7 @@ onload = function() {
|
|||
// page and the test timing out
|
||||
test_obj.force_timeout();
|
||||
}
|
||||
step_timeout(poll, 200);
|
||||
test_obj.step_timeout(poll, 200);
|
||||
} else {
|
||||
assert_equals(xhr.response, expected);
|
||||
test_obj.done();
|
||||
|
@ -43,7 +46,7 @@ onload = function() {
|
|||
});
|
||||
xhr.send();
|
||||
})
|
||||
step_timeout(poll, 200);
|
||||
test_obj.step_timeout(poll, 200);
|
||||
}
|
||||
|
||||
// background attribute, check with getComputedStyle
|
||||
|
@ -505,55 +508,6 @@ onload = function() {
|
|||
}, 'window.open()',
|
||||
{help:'https://html.spec.whatwg.org/multipage/#dom-open'});
|
||||
|
||||
// location
|
||||
function test_location(func, desc) {
|
||||
async_test(function() {
|
||||
var iframe = document.createElement('iframe');
|
||||
document.body.appendChild(iframe);
|
||||
this.add_cleanup(function() {
|
||||
document.body.removeChild(iframe);
|
||||
});
|
||||
func(iframe.contentWindow, input_url_html);
|
||||
iframe.onload = this.step_func(function() {
|
||||
var got = iframe.contentDocument.body.textContent;
|
||||
if (got != '') {
|
||||
assert_equals(got, expected_current);
|
||||
this.done();
|
||||
}
|
||||
});
|
||||
}, desc,
|
||||
{help:'https://html.spec.whatwg.org/multipage/#the-location-interface'});
|
||||
}
|
||||
[[function(win, input) { win.location = input; }, "location [PutForwards]"],
|
||||
[function(win, input) { win.location.assign(input); }, "location.assign()"],
|
||||
[function(win, input) { win.location.replace(input); }, "location.replace()"],
|
||||
[function(win, input) { win.location.href = input; }, "location.href"]].forEach(function(arr) {
|
||||
test_location(arr[0], arr[1]);
|
||||
});
|
||||
|
||||
// location.search
|
||||
async_test(function() {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = input_url_html;
|
||||
document.body.appendChild(iframe);
|
||||
this.add_cleanup(function() {
|
||||
document.body.removeChild(iframe);
|
||||
});
|
||||
var i = 0;
|
||||
iframe.onload = this.step_func(function() {
|
||||
i++;
|
||||
if (i == 1) {
|
||||
iframe.contentWindow.location.search = '?' + input_url_html.split('?')[1] + '&other=foobar';
|
||||
} else {
|
||||
var got = iframe.contentDocument.body.textContent;
|
||||
assert_equals(got, expected_current);
|
||||
this.done();
|
||||
}
|
||||
});
|
||||
}, 'location.search',
|
||||
{help:['https://html.spec.whatwg.org/multipage/#the-location-interface',
|
||||
'http://url.spec.whatwg.org/#dom-url-search']});
|
||||
|
||||
// a.search, area.search
|
||||
function test_hyperlink_search(tag) {
|
||||
test(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue