Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e

This commit is contained in:
Ms2ger 2016-12-28 09:51:21 +01:00
parent 81ca858678
commit d6ba94ca28
2339 changed files with 89274 additions and 9328 deletions

View file

@ -0,0 +1,58 @@
<!DOCTYPE html>
<title>onauxclick</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-onauxclick">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="auxclickme1" onauxclick="window.auxClick1Happened = true;"></div>
<div id="auxclickme2" onauxclick="window.auxClick2Happened = true;"></div>
<script>
"use strict";
window.auxClick1Happened = false;
window.auxClick2Happened = false;
test(() => {
for (const location of [window, HTMLElement.prototype, SVGElement.prototype, Document.prototype]) {
assert_true(location.hasOwnProperty("onauxclick"),
`${location.constructor.name} has an own property named "onauxclick"`);
}
}, "onauxclick is on the appropriate locations for GlobalEventHandlers");
test(() => {
const htmlElement = document.createElement("span");
const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "g");
for (const location of [window, htmlElement, svgElement, document]) {
assert_equals(location.onauxclick, null,
`The default value of the property is null for a ${location.constructor.name} instance`);
}
}, "The default value of onauxclick is always null");
test(() => {
const element = document.querySelector("#auxclickme1");
const compiledHandler = element.onauxclick;
assert_equals(typeof compiledHandler, "function", "The onauxclick property must be a function");
compiledHandler();
assert_true(window.auxClick1Happened, "Calling the handler must run the code");
}, "The onauxclick content attribute must be compiled into the onauxclick property");
test(() => {
const element = document.querySelector("#auxclickme2");
element.dispatchEvent(new Event("auxclick"));
assert_true(window.auxClick2Happened, "Dispatching the event must run the code");
}, "The onauxclick content attribute must execute when an event is dispatched");
test(() => {
const element = document.createElement("meta");
element.onauxclick = e => {
assert_equals(e.currentTarget, element, "The event must be fired at the <meta> element");
};
element.dispatchEvent(new Event("auxclick"));
}, "dispatching an auxclick event must trigger element.onauxclick");
</script>

View file

@ -0,0 +1,36 @@
<!doctype html>
<html>
<head>
<title>window.onerror - compile error in &lt;script src=...> with hash</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script>
setup({allow_uncaught_exception:true});
var t = async_test();
var t_col = async_test(document.title+' (column)');
var ran = false;
var col_value;
window.onerror = t.step_func(function(a, b, c, d){
ran = true;
col_value = d;
assert_equals(typeof a, 'string', 'first arg');
assert_equals(b, document.querySelector('script[src="support/syntax-error.js#"]').src, 'second arg');
assert_equals(typeof c, 'number', 'third arg');
});
</script>
<script src="support/syntax-error.js#"></script>
<script>
t.step(function(){
assert_true(ran, 'ran');
t.done();
});
t_col.step(function(){
assert_equals(typeof col_value, 'number', 'fourth arg');
t_col.done();
});
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!doctype html>
<html>
<head>
<title>window.onerror - runtime error in &lt;script src=...> with hash</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script>
setup({allow_uncaught_exception:true});
var t = async_test();
var t_col = async_test(document.title+' (column)');
var ran = false;
var col_value;
window.onerror = t.step_func(function(a, b, c, d){
ran = true;
col_value = d;
assert_equals(typeof a, 'string', 'first arg');
assert_equals(b, document.querySelector('script[src="support/undefined-variable.js#"]').src, 'second arg');
assert_equals(typeof c, 'number', 'third arg');
});
</script>
<script src="support/undefined-variable.js#"></script>
<script>
t.step(function(){
assert_true(ran, 'ran');
t.done();
});
t_col.step(function(){
assert_equals(typeof col_value, 'number', 'fourth arg');
t_col.done();
});
</script>
</body>
</html>