3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"profiler-test.js"></script>
7 function pageFunction() {
9 console
.profileEnd("p1");
10 console
.profile("p1");
11 console
.profileEnd("p1");
12 console
.profile("p2");
13 console
.profileEnd("p2");
18 InspectorTest
.startProfilerTest(function() {
19 function viewLoaded() {
20 var profiles
= WebInspector
.panels
.profiles
;
21 var type
= WebInspector
.ProfileTypeRegistry
.instance
.cpuProfileType
;
22 while (type
.getProfiles().length
!== 0)
23 type
.removeProfile(type
.getProfiles()[0]);
24 InspectorTest
.addResult("Profile groups after removal:");
25 for (var key
in profiles
._profileGroups
)
26 InspectorTest
.addResult(key
+ ": " + profiles
._profileGroups
[key
].length
);
27 var section
= profiles
._typeIdToSidebarSection
[type
.id
];
28 InspectorTest
.assertEquals(0, section
.children
.length
, "All children has been removed");
29 InspectorTest
.completeProfilerTest();
31 InspectorTest
.evaluateInPage("pageFunction()", function() {});
32 InspectorTest
.showProfileWhenAdded("p2");
33 InspectorTest
.waitUntilProfileViewIsShown("p2", setTimeout
.bind(null, viewLoaded
, 0));
39 <body onload=
"runTest()">
41 Tests that CPU profile removal from a group works.
43 <a href=
"https://bugs.webkit.org/show_bug.cgi?id=110466">Bug
110466</a>