blob: b385326a694e760a4ae6df86ccb909d8b6af0409 [file] [log] [blame]
<!DOCTYPE html>
<!--
| This is not a real layout test but rather a manual test for |console.trace()|
| which prints JavaScript stack trace. When run in automated mode, it will only
| ensure that invocation to |console.trace()| do not crash under various
| circumstances.
-->
<!-- TODO: Figure out how to test debug console functionality, given that most
of it is unobservable by user code. -->
<html>
<head>
<title></title>
</head>
<body>
<script>
// Call from top-level frame.
//
// Expected output:
// (anonymous function) @ console-trace-should-not-crash.html:21
console.trace();
</script>
<script>
// Call from non-top-level frame.
//
// Expected output:
// z @ console-trace-should-not-crash.html:34
// y @ console-trace-should-not-crash.html:38
// x @ console-trace-should-not-crash.html:42
// (anonymous function) @ console-trace-should-not-crash.html:45
function z() {
console.trace();
}
function y() {
z();
}
function x() {
y();
}
x();
</script>
<script>
// Call from recursive function.
//
// Expected output:
// a @ console-trace-should-not-crash.html:67
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// a @ console-trace-should-not-crash.html:69
// (anonymous function) @ console-trace-should-not-crash.html:73
function a(i) {
if (i == 10) {
console.trace();
} else {
a(i + 1);
}
}
a(0);
</script>
<!-- Call from external JavaScript file. -->
<script src="console-trace-should-not-crash.js"></script>
</body>
</html>