Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -1,2 +1,3 @@
@domenic
@pwnall
@domfarolino

View file

@ -0,0 +1,24 @@
"use strict";
// https://console.spec.whatwg.org/#count
test(() => {
let countLabelToStringCalled = false;
console.count({
toString() {
countLabelToStringCalled = true;
}
});
assert_true(countLabelToStringCalled, "toString() must be called on count()'s label when label is an object");
}, "console.count()'s label gets converted to string via label.toString() when label is an object");
test(() => {
assert_throws({name: "Error"}, () => {
console.count({
toString() {
throw new Error("conversion error");
}
});
}, "count() must re-throw any exceptions thrown by label.toString() conversion");
}, "console.count() throws exceptions generated by erroneous label.toString() conversion");

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Console Count - Logging Manual Test</title>
<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
<meta name="assert" content="Console count method default parameter should work">
<link rel="help" href="https://console.spec.whatwg.org/#count">
</head>
<body>
<p>Open the console inside the developer tools. It should contain four lines whose contents are:</p>
<p><code>default: 1</code></p>
<p><code>default: 2</code></p>
<p><code>default: 3</code></p>
<p><code>default: 4</code></p>
<script>
console.count();
console.count(undefined);
console.count("default");
console.count({toString() {return "default"}});
</script>
</body>
</html>

View file

@ -0,0 +1,46 @@
"use strict";
// https://console.spec.whatwg.org/#timing
test(() => {
let timeLabelToStringCalled = false;
console.time({
toString() {
timeLabelToStringCalled = true;
}
});
assert_true(timeLabelToStringCalled, "toString() must be called on time()'s label when label is an object");
}, "console.time()'s label gets converted to string via label.toString() when label is an object");
test(() => {
let timeEndLabelToStringCalled = false;
console.timeEnd({
toString() {
timeEndLabelToStringCalled = true;
}
});
assert_true(timeEndLabelToStringCalled, "toString() must be called on timeEnd()'s label when label is an object");
}, "console.timeEnd()'s label gets converted to string via label.toString() when label is an object");
test(() => {
assert_throws({name: "Error"}, () => {
console.time({
toString() {
throw new Error("conversion error");
}
});
}, "time() must re-throw any exceptions thrown by label.toString() conversion");
}, "console.time() throws exceptions generated by erroneous label.toString() conversion");
test(() => {
assert_throws({name: "Error"}, () => {
console.timeEnd({
toString() {
throw new Error("conversion error");
}
});
}, "timeEnd() must re-throw any exceptions thrown by label.toString() conversion");
}, "console.timeEnd() throws exceptions generated by erroneous label.toString() conversion");

View file

@ -0,0 +1,9 @@
"use strict";
test(() => {
assert_equals(console.timeline, undefined, "console.timeline should be undefined");
}, "'timeline' function should not exist on the console object");
test(() => {
assert_equals(console.timelineEnd, undefined, "console.timelineEnd should be undefined");
}, "'timelineEnd' function should not exist on the console object");