[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
mnaganov at chromium.org
mnaganov at chromium.org
Sun Feb 20 23:14:56 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 74f79aced1389d503321aa45d3fd024f20010694
Author: mnaganov at chromium.org <mnaganov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 19 12:23:42 2011 +0000
works in safari
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/inspector/cpu-profiler-profiling-expected.txt b/LayoutTests/inspector/cpu-profiler-profiling-expected.txt
index 3944532..40276bc 100644
--- a/LayoutTests/inspector/cpu-profiler-profiling-expected.txt
+++ b/LayoutTests/inspector/cpu-profiler-profiling-expected.txt
@@ -1,4 +1,4 @@
Tests that CPU profiling works.
-found fib
+found pageFunction
diff --git a/LayoutTests/inspector/cpu-profiler-profiling.html b/LayoutTests/inspector/cpu-profiler-profiling.html
index 85b6c2f..dd8cb79 100644
--- a/LayoutTests/inspector/cpu-profiler-profiling.html
+++ b/LayoutTests/inspector/cpu-profiler-profiling.html
@@ -3,73 +3,58 @@
<script src="../http/tests/inspector/inspector-test2.js"></script>
<script>
-function fib(n) {
- return n < 2 ? 1 : fib(n - 1) + fib(n - 2);
-}
-
-function eternal_fib() {
+function pageFunction() {
console.profile(); // Make sure we capture the current callstack.
- for (var i = 0; i < 50; ++i) {
- fib(20);
- }
console.profileEnd();
}
-function run()
-{
- eternal_fib();
- runTest();
-}
-
function initialize_ProfilerTests()
{
- InspectorTest.findDisplayedNode = function() {
- var panel = WebInspector.panels.profiles;
- var tree = panel.visibleView.profileDataGridTree;
- if (!tree) {
- window.setTimeout(InspectorTest.findDisplayedNode, 100);
- return;
- }
+ InspectorTest.findPageFunctionProfileNode = function() {
+ var panel = WebInspector.panels.profiles;
+ if (!panel)
+ InspectorTest.addResult("no panel");
+ var view = panel.visibleView;
+ if (!view)
+ InspectorTest.addResult("no view");
+ var tree = view.profileDataGridTree;
+ if (!tree)
+ InspectorTest.addResult("no tree");
var node = tree.children[0];
- if (!node) {
- // Profile hadn't been queried yet, re-schedule.
- window.setTimeout(InspectorTest.findDisplayedNode, 100);
- return;
- }
-
- // Iterate over displayed functions and search for a function
- // that is called "fib" or "eternal_fib". If found, this will mean
- // that we actually have profiled page's code.
+ if (!node)
+ InspectorTest.addResult("no node");
while (node) {
- if (node.functionName.indexOf("fib") !== -1) {
- InspectorTest.addResult("found fib");
+ if (node.functionName.indexOf("pageFunction") !== -1) {
+ InspectorTest.addResult("found pageFunction");
break;
}
node = node.traverseNextNode(true, null, true);
}
-
InspectorTest.completeTest();
}
- InspectorTest.findVisibleView = function() {
- var panel = WebInspector.panels.profiles;
- if (!panel.visibleView) {
- setTimeout(InspectorTest.findVisibleView, 0);
- return;
- }
- setTimeout(InspectorTest.findDisplayedNode, 0);
+ var oldRefresh = WebInspector.CPUProfileView.prototype.refresh;
+ WebInspector.CPUProfileView.prototype.refresh = function()
+ {
+ oldRefresh.call(this);
+ InspectorTest.findPageFunctionProfileNode();
}
}
function test()
{
WebInspector.showPanel("profiles");
- InspectorTest.findVisibleView();
+ WebInspector.panels.profiles._enableProfiling();
+ InspectorBackend.startProfiling();
+ InspectorTest.evaluateInConsole("pageFunction()", function done()
+ {
+ InspectorBackend.stopProfiling();
+ });
}
</script>
</head>
-<body onload="run()">
+<body onload="runTest()">
<p>
Tests that CPU profiling works.
</p>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list