Commit 6d784dd8 authored by kmccullough@apple.com's avatar kmccullough@apple.com

2008-05-20 Kevin McCullough <kmccullough@apple.com>

        Reviewed by Tim.

        Added all of my personal manual tests for the profiler.

        * manual-tests/inspector/profiler-test-anonymous-event-handler.html: Added.
        * manual-tests/inspector/profiler-test-anonymous-function-called-from-different-contexts.html: Added.
        * manual-tests/inspector/profiler-test-anonymous-function-calls-built-in-functions.html: Added.
        * manual-tests/inspector/profiler-test-anonymous-function-calls-eval.html: Added.
        * manual-tests/inspector/profiler-test-apply.html: Added.
        * manual-tests/inspector/profiler-test-built-in-function-calls-anonymous.html: Added.
        * manual-tests/inspector/profiler-test-built-in-function-calls-user-defined-function.html: Added.
        * manual-tests/inspector/profiler-test-call.html: Added.
        * manual-tests/inspector/profiler-test-dead-time.html: Added.
        * manual-tests/inspector/profiler-test-event-handler.html: Added.
        * manual-tests/inspector/profiler-test-execution-context-and-eval-on-same-line.html: Added.
        * manual-tests/inspector/profiler-test-inline-event-handler.html: Added.
        * manual-tests/inspector/profiler-test-many-calls-in-the-same-scope.html: Added.
        * manual-tests/inspector/profiler-test-multiple-and-different-scoped-anonymous-function-calls.html: Added.
        * manual-tests/inspector/profiler-test-multiple-and-different-scoped-function-calls.html: Added.
        * manual-tests/inspector/profiler-test-multiple-frames.html: Added.
        * manual-tests/inspector/profiler-test-multiple-windows.html: Added.
        * manual-tests/inspector/profiler-test-nested-anonymous-functon.html: Added.
        * manual-tests/inspector/profiler-test-nested-start-and-stop-profiler.html: Added.
        * manual-tests/inspector/profiler-test-no-execution-context.html: Added.
        * manual-tests/inspector/profiler-test-one-execution-context.html: Added.
        * manual-tests/inspector/profiler-test-profile-calls-in-included-file.html: Added.
        * manual-tests/inspector/profiler-test-profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html: Added.
        * manual-tests/inspector/profiler-test-profiling-from-a-nested-location.html: Added.
        * manual-tests/inspector/profiler-test-start-and-stop-profiler-multiple-times.html: Added.
        * manual-tests/inspector/profiler-test-two-execution-contexts.html: Added.
        * manual-tests/inspector/profiler-test-user-defined-function-calls-built-in-functions.html: Added.
        * manual-tests/inspector/resources: Added.
        * manual-tests/inspector/resources/other-frame.html: Added.
        * manual-tests/inspector/resources/other-window.html: Added.
        * manual-tests/inspector/resources/profiler-test-JS-resources.js: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aeb5dd75
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
Added all of my personal manual tests for the profiler.
* manual-tests/inspector/profiler-test-anonymous-event-handler.html: Added.
* manual-tests/inspector/profiler-test-anonymous-function-called-from-different-contexts.html: Added.
* manual-tests/inspector/profiler-test-anonymous-function-calls-built-in-functions.html: Added.
* manual-tests/inspector/profiler-test-anonymous-function-calls-eval.html: Added.
* manual-tests/inspector/profiler-test-apply.html: Added.
* manual-tests/inspector/profiler-test-built-in-function-calls-anonymous.html: Added.
* manual-tests/inspector/profiler-test-built-in-function-calls-user-defined-function.html: Added.
* manual-tests/inspector/profiler-test-call.html: Added.
* manual-tests/inspector/profiler-test-dead-time.html: Added.
* manual-tests/inspector/profiler-test-event-handler.html: Added.
* manual-tests/inspector/profiler-test-execution-context-and-eval-on-same-line.html: Added.
* manual-tests/inspector/profiler-test-inline-event-handler.html: Added.
* manual-tests/inspector/profiler-test-many-calls-in-the-same-scope.html: Added.
* manual-tests/inspector/profiler-test-multiple-and-different-scoped-anonymous-function-calls.html: Added.
* manual-tests/inspector/profiler-test-multiple-and-different-scoped-function-calls.html: Added.
* manual-tests/inspector/profiler-test-multiple-frames.html: Added.
* manual-tests/inspector/profiler-test-multiple-windows.html: Added.
* manual-tests/inspector/profiler-test-nested-anonymous-functon.html: Added.
* manual-tests/inspector/profiler-test-nested-start-and-stop-profiler.html: Added.
* manual-tests/inspector/profiler-test-no-execution-context.html: Added.
* manual-tests/inspector/profiler-test-one-execution-context.html: Added.
* manual-tests/inspector/profiler-test-profile-calls-in-included-file.html: Added.
* manual-tests/inspector/profiler-test-profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html: Added.
* manual-tests/inspector/profiler-test-profiling-from-a-nested-location.html: Added.
* manual-tests/inspector/profiler-test-start-and-stop-profiler-multiple-times.html: Added.
* manual-tests/inspector/profiler-test-two-execution-contexts.html: Added.
* manual-tests/inspector/profiler-test-user-defined-function-calls-built-in-functions.html: Added.
* manual-tests/inspector/resources: Added.
* manual-tests/inspector/resources/other-frame.html: Added.
* manual-tests/inspector/resources/other-window.html: Added.
* manual-tests/inspector/resources/profiler-test-JS-resources.js: Added.
2008-05-20 Adam Roben <aroben@apple.com>
Use KJS::List::getSlice instead of reimplementing it
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Anonymous event handler");
function testStart()
{
var buttonWithAnonymousHandler = document.getElementById("buttonWithAnAnonymousEventHandler")
buttonWithAnonymousHandler.onclick = function () {
insertNewText();
}
buttonWithAnonymousHandler.click();
endTest();
}
</script>
</head>
<body onload="testStart()">
This page has an anonymous event handler.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. It should show the anonymous function at the same level as the onload
handler.
<input type="button" id="buttonWithAnAnonymousEventHandler" value="Button with an anonymous event handler">
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Same anonymous function called from different contexts");
function startTest()
{
anonymousFunction();
eval("anonymousFunction()");
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls an anonymous function from different contexts.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. Beneath onload and startTest it should show three children, an
anonymous function, script context, and the endTest call.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Anonymous function calls built-in functions");
function startTest()
{
anonymousFunction();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page has an anonymous JavaScript function that calls built-in functions.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. Beneath onload and startTest it should show three children, an
anonymous function, script context, and the endTest call.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Anonymous function calles eval");
function startTest()
{
var variableThatPointsToAnAnonymousFunction = function() {
eval("insertNewText()");
}
variableThatPointsToAnAnonymousFunction();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls an anonymous function which calls eval().
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. Beneath onload and startTest it should show an (anonymous function)
which has a (global code) child.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Using the call() method");
function startTest()
{
var myObject = new fakeObject(1, 2);
endTest();
}
function fakeObject (x, y)
{
this.x = x;
fakeInteriorFunction.apply(this, arguments);
}
function fakeInteriorFunction(x, y)
{
this.y = y;
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript has a call to apply() in it.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a call to fakeInteriorFunction() but
not to apply().
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Built-in function calls an anonymous function");
function testStart()
{
var myFunction = function(arrayElement) {
return arrayOperatorFunction(arrayElement);
}
var myArray = new Array (0, 1, 2);
myArray.map(myFunction);
endTest();
}
</script>
</head>
<body onload="testStart()">
This page uses a built-in function to call an anonymous function.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile map() should be the sibling of an (anonymous function)
which has arrayOperatorFunction() as a child.
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Built-in function calls a user defined function");
function testStart()
{
var myArray = new Array (0, 1, 2);
myArray.map(arrayOperatorFunction);
endTest();
}
</script>
</head>
<body onload="testStart()">
This page uses a built-in function to call a user defined function.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile map() should have arrayOperatorFunction() as a child.
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Using the call() method");
function startTest()
{
var myObject = new fakeObject(1, 2);
endTest();
}
function fakeObject (x, y)
{
this.x = x;
fakeInteriorFunction.call(this, y);
}
function fakeInteriorFunction(y)
{
this.y = y;
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript has a call to call() in it.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a call to fakeObject with
fakeInteriorFunction as its child, but call() should not be shown.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Dead time in profile.");
function startTest()
{
setTimeout("endTest()", 1234);
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript Has some dead time in the profile.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a large amount of the % spent in
(non-JavaScript).
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Event handler");
function testStart()
{
var myButton = document.getElementById("buttonWithAnEventListener");
myButton.addEventListener('click', insertNewText, false);
myButton.click();
endTest();
}
</script>
</head>
<body onload="testStart()">
This page has an event handler.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile insertnewText() should be a sibling to onload().
<input type="button" id="buttonWithAnEventListener" value="Button with an event listener">
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Two Execution Contexts on the same line");
function testStart()
{
evalFunction();
endTest();
}
</script>
<script> eval("function evalFunction() { insertNewText(); }");</script>
</head>
<body onload="testStart()">
This page has a call to eval and a script tag on the same line.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be multiple (global code) elements and
one that represents the eval(). This won't work until <rdar://problem/5766941>
is fixed.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Inline event handler");
function testStart()
{
document.getElementById("eventListenerSetInline").click();
}
function eventListener() {
anonymousFunction();
endTest();
}
</script>
</head>
<body onload="testStart()">
This page has an inline event handler.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile onclick() should be a sibling to onload() and onclick()
should have eventListener() as a child.
<input type="button" onclick="eventListener()" id="eventListenerSetInline" value="Event Listener Set Inline">
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Many Calls In The Same Scope");
function startTest()
{
insertNewText();
insertGivenText("This was a triumph.");
arrayOperatorFunction(7);
intermediaryFunction();
anonymousFunction();
end()
endT();
endT();
endTest();
}
function end()
{
var x = 0;
}
function endT()
{
var y = 1;
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript has many function calls in the same scope.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile many functions should be the children of startTest.
Use the sorting capabilites to make sure the similarly named functions are sorted
correctly.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Multiple and different scoped calls to the same anonymous function");
function startTest()
{
anonymousFunction();
anonymousFunction();
intermediaryFunction();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls the same anonymous function from multiple and differently scoped locations.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a call to fakeObject with
fakeInteriorFunction as its child, but call() should not be shown.
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Multiple and different scoped calls to the same function");
function startTest()
{
insertNewText();
insertNewText();
intermediaryFunction();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls the same function from multiple and differently scoped locations.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be two calls to insertNewText under
startTest() and one under an (anonymous function) under intermediaryFunction().
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Other window executing JavaScript");
function testStart()
{
var myFrame = document.getElementById("mySubFrame");
var secret = myFrame.contentWindow.functionInOtherFrame();
insertGivenText(secret);
endTest();
}
function functionInParentFrame() {
return "Pi";
}
</script>
</head>
<body onload="testStart()">
This test has JS executing in another window.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a call to functionInOtherFrame().
<div id="output"></div>
<iframe src="resources/other-frame.html" id="mySubFrame"></iframe>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Other window executing JavaScript");
var w;
function testStart()
{
insertNewText()
w = window.open("resources/other-window.html");
}
function windowFinishedLoading() {
w.functionInOtherWindow();
w.close();
endTest();
}
</script>
</head>
<body onload="testStart()">
This test has JS executing in another window.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be a call to otherTestStart().
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Nested anonymous functions called");
function startTest()
{
var AnonymousFunctionWichCallsAnAnonymousFunction = function() {
anonymousFunction();
}
AnonymousFunctionWichCallsAnAnonymousFunction();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls an anonymous which calls a nested anonymous function.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profile there should be an (anonymous function) with a child
(anonymous function).
<div id="output"></div>
</body>
</html>
\ No newline at end of file
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
console.profile("Start the profiler the first time.");
function startTest()
{
console.profile("Sthart the profiler the second time.");
console.profile("Sthart the profiler the third time.");
endTest();
endTest();
endTest();
}
</script>
</head>
<body onload="startTest()">
This page's JavaScript calls console.profile() three times then console.profileEnd()
three times.
<br>
<br>
To use this test, load it in the browser then load the WebInspector and look at
the profile. In the profiler there should be three profiles.
</body>
</html>
\ No newline at end of file
<html>
<head>
</head>
<body>
This page has a no script tag and so has no execution context or profiling information.
<br>