Commit 8c8802b9 authored by mnaganov@chromium.org's avatar mnaganov@chromium.org
Browse files

2011-01-21 Mikhail Naganov <mnaganov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: Add layout test for the CPU profiler.

        This test replaces DevToolsSanityTest.TestProfilerTab from
        Chromium's interactive_ui_tests.

        https://bugs.webkit.org/show_bug.cgi?id=52634

        * inspector/cpu-profiler-profiling-expected.txt: Added.
        * inspector/cpu-profiler-profiling.html: Added.

[Relanding, this time the test should work in Chromium]

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83d221f9
2011-01-21 Mikhail Naganov <mnaganov@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: Add layout test for the CPU profiler.
This test replaces DevToolsSanityTest.TestProfilerTab from
Chromium's interactive_ui_tests.
https://bugs.webkit.org/show_bug.cgi?id=52634
* inspector/cpu-profiler-profiling-expected.txt: Added.
* inspector/cpu-profiler-profiling.html: Added.
2011-01-21 Csaba Osztrogonác <ossy@webkit.org>
 
Unreviewed.
......
Tests that CPU profiling works. Bug 52634.
found pageFunction
<html>
<head>
<script src="../http/tests/inspector/inspector-test2.js"></script>
<script>
function pageFunction() {
console.profile("outer");
console.profile("inner"); // [Chromium] Make sure we capture the current callstack.
console.profileEnd("outer");
console.profileEnd("inner");
}
function initialize_ProfilerTests()
{
var oldAddProfileHeader = WebInspector.panels.profiles._addProfileHeader;
WebInspector.panels.profiles._addProfileHeader = function(profile)
{
oldAddProfileHeader.call(this, profile);
if (profile.title === "inner") {
this.showProfile(profile);
}
}
var oldRefresh = WebInspector.CPUProfileView.prototype.refresh;
WebInspector.CPUProfileView.prototype.refresh = function()
{
oldRefresh.call(this);
if (this.profile.title === "inner") {
var tree = this.profileDataGridTree;
if (!tree)
InspectorTest.addResult("no tree");
var node = tree.children[0];
if (!node)
InspectorTest.addResult("no node");
while (node) {
if (node.functionName.indexOf("pageFunction") !== -1) {
InspectorTest.addResult("found pageFunction");
break;
}
node = node.traverseNextNode(true, null, true);
}
InspectorTest.completeTest();
}
}
}
function test()
{
WebInspector.showPanel("profiles");
WebInspector.panels.profiles._enableProfiling();
InspectorTest.evaluateInConsole("pageFunction()", function done() {});
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that CPU profiling works.
<a href="https://bugs.webkit.org/show_bug.cgi?id=52634">Bug 52634.</a>
</p>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment