[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:50 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit cfbc645577b3375c8578ec30aeacdbee54eb4fca
Author: mnaganov at chromium.org <mnaganov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 19 12:23:21 2011 +0000
added test
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/inspector/cpu-profiler-profiling-expected.txt b/LayoutTests/inspector/cpu-profiler-profiling-expected.txt
new file mode 100644
index 0000000..3944532
--- /dev/null
+++ b/LayoutTests/inspector/cpu-profiler-profiling-expected.txt
@@ -0,0 +1,4 @@
+Tests that CPU profiling works.
+
+found fib
+
diff --git a/LayoutTests/inspector/cpu-profiler-profiling.html b/LayoutTests/inspector/cpu-profiler-profiling.html
new file mode 100644
index 0000000..85b6c2f
--- /dev/null
+++ b/LayoutTests/inspector/cpu-profiler-profiling.html
@@ -0,0 +1,77 @@
+<html>
+<head>
+ <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() {
+ 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;
+ }
+ 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.
+ while (node) {
+ if (node.functionName.indexOf("fib") !== -1) {
+ InspectorTest.addResult("found fib");
+ 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);
+ }
+}
+
+function test()
+{
+ WebInspector.showPanel("profiles");
+ InspectorTest.findVisibleView();
+}
+
+</script>
+</head>
+<body onload="run()">
+<p>
+Tests that CPU profiling works.
+</p>
+</body>
+</html>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list