Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / profiler / cpu-profiler-profiling.html
blobb32ca0cb2351c3e086d3d778fa71141f25397df6
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="profiler-test.js"></script>
5 <script>
7 function pageFunction() {
8 (function () {
9 console.profile("profile");
10 console.profileEnd("profile");
11 })();
14 function test()
16 function checkFunction(name, tree)
18 var node = tree.children[0];
19 if (!node)
20 InspectorTest.addResult("no node");
21 while (node) {
22 if (node.functionName === name) {
23 InspectorTest.addResult("found " + name);
24 return;
26 node = node.traverseNextNode(true, null, true);
28 InspectorTest.addResult(name + " not found");
31 InspectorTest.runProfilerTestSuite([
32 function testProfiling(next)
34 function findPageFunctionInProfileView(view)
36 var tree = view.profileDataGridTree;
37 if (!tree)
38 InspectorTest.addResult("no tree");
39 checkFunction("pageFunction", tree);
40 checkFunction("(anonymous function)", tree);
41 next();
43 InspectorTest.showProfileWhenAdded("profile");
44 InspectorTest.waitUntilProfileViewIsShown("profile", findPageFunctionInProfileView);
45 InspectorTest.evaluateInPage("pageFunction()", function done() {});
47 ]);
50 </script>
51 </head>
52 <body onload="runTest()">
53 <p>
54 Tests that CPU profiling works.
56 <a href="https://bugs.webkit.org/show_bug.cgi?id=52634">Bug 52634.</a>
57 </p>
58 </body>
59 </html>